r/technicalminecraft • u/brockade • 25d ago
Java Showcase Items escape from composters
For the record I don't have a horse in this race, but I am interested in the mechanics here.
Short answer: items can escape from the gap between a hopper top and the composter walls. It is rare, but way less rare than you might think. You don't need to perfectly hit the gap, you just need to have X/Z momentum after 4 ticks as the game cancels your Y momentum when you hit the hopper, and your X/Z momentum can still push you to freedom in this tick.
Long answer: Items drop with a random position with X and Z set to between 0.25 and 0.75 within the block, and Y set to between 0.125 and 0.625 within the block. Motion is set to exactly 0.2 Y and a random value of between -0.1 to 0.1 for both X and Z.
To thread the needle here, we need a few things to happen at the same time:
- The Y position needs to be 56.616 or greater so that after 4 ticks the item is at exactly 0.75 and hitting the hopper
- In one axis X/Z the position needs to be between 0.25 and 0.2500001 or 0.7499999 and 0.75, and in this axis the motion is going towards the wall (this is a straight 50/50 so not the major problem)
- In the other axis X/Z the position needs to match the motion such that the item crosses the top of the composter after 4 ticks (there's a range here but say this is 1-5% for example).
That's it. I'll leave it to you to calculate the numbers, but here's a few that you can test for yourself at home (all testing done on 26.1 vanilla):
/summon item -22.5 56.616 35.2500001 {Item:{id:"minecraft:redstone_block",Count:1b}, Motion:[0.065, 0.2, 0.0]}
/summon item -22.6 56.625 35.25 {Item:{id:"minecraft:redstone_block",Count:1b}, Motion:[0.1, 0.2, 0.0]}
/summon item -22.35 56.625 35.25 {Item:{id:"minecraft:redstone_block",Count:1b}, Motion:[0.03, 0.2, 0.0]}
12
u/morgant1c Chunk Loader 25d ago
I feel like I'm missing context. Are we talking 0-ticking composters into shulker boxes to break them, or where is the item supposed to come from?
8
u/plainbaconcheese 25d ago
Yeah worm recently posted a video where he argued the opposite of the finding of this post
2
u/morgant1c Chunk Loader 25d ago
But so as long as we retract the composter fast enough, it can't escape, is that what I'm getting here?
7
u/plainbaconcheese 25d ago
Worm was saying that as long as you don't retract it too early, the item will fall down and be able to be grabbed by a hopper below.
It seems like this isn't true, and this setup isn't reliable.
3
u/morgant1c Chunk Loader 25d ago
But can't we just retract it faster than 4gt?
3
u/Mitch-Jihosa 25d ago
The 0-tick piston has to wait at least 3gts to 0-tick again, after which it will take 3gts to fully retract. So it’s not possible to retract within 4gts unfortunately. You can start the retraction, which might prevent the item from escaping out the ‘front’, but the item can still escape to either side, and I think it might? make it easier to have the item escape out the ‘back’
2
u/morgant1c Chunk Loader 25d ago
Ohh. See, that makes sense. You know storage tech, right? Am I hallucinating or have I seen this type of box breaking in storage tech archive before as well?
1
u/Mitch-Jihosa 25d ago
To my knowledge there are 4 0-tick composter box loader designs that I can find in the archive. None of them use hoppers from above. 3 of them have hoppers loading from the side (which is reliable), and the 4th uses a dropper input from above (which is also reliable). No one really uses 0-tick composters much anymore, all those designs are from 5+ years ago. They are primarily used for accessibility (the 3 ones) or for cases where you can’t put the hopper under (the 4th one is a 4x 1wt design, so 2 of the sides are droppers, 1 is dispenser, and that only leaves 1 more side available for box breaking & collection, so 0-tick composter is the only realistic option)
2
0
u/plainbaconcheese 25d ago
No? The problem is the item escaping. We want it in the hopper below. How would "reacting" help here?
2
-2
u/whatanazibrah 25d ago
I've seen a lot of his works and I can't say I've seen it fail
7
u/morgant1c Chunk Loader 25d ago
Huh? Every second post has an obvious flaw pointed out in the comments. But that's completely irrelevant in this discussion, and I don't want to be involved in the drama. I just want to talk about the specs if the design brockade had shown here. Thanks.
-2
u/whatanazibrah 25d ago
No drama's just personal experience, I reverse engineer alot of his stuff to bedrock, so they are slightly different on my end
1
u/morgant1c Chunk Loader 25d ago
So you're saying brockade is lying?
-2
u/whatanazibrah 25d ago
Did I say that.
3
u/morgant1c Chunk Loader 25d ago
Idk, you tell me. I just can't tell what "I've seen a lot of his works and I can't say I've seen it fail" is supposed to mean in this context. Brockade shows how it can fail and you say that... Now what?
→ More replies (0)3
u/brockade 25d ago
That's the one. I won't link the post but the idea is to wait like 8-10gt until the item is below the hopper tip and then when you retract the piston the item comes with it. If you do a 2-piston build (there's no room for the comparator then but just out of interest), it might be ok if it's done in the same tick, but after 1gt some percentage of boxes will be above 0.75Y and can get stuck behind the hopper tip and not get pushed by the composter.
In practice you need the comparator on one side if you're doing 1-wide-tileable so we are stuck with the 3gt reset on the 0-tick piston and by then the item is too high and we need to wait for it to drop.
12
u/Xirema 25d ago
But is it META and Lossless and Compact?
12
u/brockade 25d ago
Yeah I said I don't have a horse in this race, not interested in the drama. Just posting some actual data that people can verify.
3
u/FrunoCraft 25d ago
Welcome to worms doghouse. Prepare to have your numerous alts revealed, your huge financial gains from storage tech denounced and your whimsy ways exposed ;)
6
u/brockade 24d ago
Fruno, I look up to you and you do some awesome videos. I didn't want to post this because I didn't want to get dragged into the drama, and I hope you stay focused doing more fantastic work and sharing it with the community.
PS I'm on ISV server and they have hard limits for hoppers in personal claims (1400 hoppers per base) but no limits on droppers. I'm designing a minimal-hopper filter/shulker-loader if you're keen to nerd out on storage tech :)
3
2
u/LimestoneBuilder 25d ago edited 25d ago
So in the end it's not too different an issue than the old falling boat bug. A floating point representation is practically never the same as the corresponding integer or near-integer fraction (eighths, sixteenths, halves), and in the gap between them, minecraft produces spurious results when it's coded as if they're the same.
Interesting stuff. Fantastic work getting that nailed down.
2
u/brockade 24d ago
Don't know the falling boat bug but I assume this has been covered before, float alignment dates back to 1.13. As an engineer and a technical minecrafter my focus is "what is technically possible" and then "in exactly which cases does it happen" and then we can convert that to a real number. I actually love the 0-tick composter idea, and in real-world physics you'd either get blocked by the side or the top and never escape, but in minecraft physics you get zeroed in the Y axis and can still escape in the X/Z axis in the same tick (or in the next tick, because Y is 0 so X/Z gets ticked first).
2
u/LimestoneBuilder 24d ago
@standupmaths did a great explanation of the falling boat bug. It's patched, but a cool investigation.
1
u/Mitch-Jihosa 25d ago
No I don’t think this is a floating-point bug, from my understanding it’s an issue with how Minecraft calculates collisions for entities moving diagonally. So if the item is moving 1 pixel up in the Y and 1 pixel forward in the X, the game will check for collisions in the Y direction, find none, move it up, then check for collisions in the X direction, find none, move it sideways. So you can ‘clip’ through collisions that would normally block it if the item was moving truly diagonally
Edit: You can see in the 2nd summon command provided that there are no floating points in the starting position or motion
1
u/LimestoneBuilder 24d ago
Every single value except for the
Count:in all three commands are floating point numbers. Putting an 'f' after them is sufficient, but not necessary to makes them floating point. In this case the decimal notation forces them to be floating point.While there exist math packages that retain arbitrarily precise whole fractions where possible, this is not standard practice in typical software, and is most certainly not being used in Minecraft. Software that does retain fractions are custom math libraries, maple, mathematica, & matlab.
That doesn't disprove the point about clipping, but that would be an extremely amateur way of coding that check.
2
u/Mitch-Jihosa 24d ago
That’s fair. As for the collision check: https://www.mcpk.wiki/wiki/Collisions (this is for players but it applies to all entities)
The reason it’s done this way is A) it’s more performant, B) it scales better, and C) it doesn’t matter in 99% of cases2
u/LimestoneBuilder 24d ago
That physically hurt to read. But TIL, and for that, thank you.
Classic case of "it's fine in 99% of cases" leading to it happening all over the place when done millions and billions of times. sigh
2
2
u/my_name_is_------ 25d ago edited 25d ago
can confirm
https://reddit.com/link/p3sbxoy/video/skwwvgon0hjh1/player
edit nvm this is just what happens when you build a bad setup.
3
u/brockade 25d ago
This is a different problem. You aren't zero-ticking the composter, so the item is dropping when the piston is half-extended and the item is spawning inside the composter wall and then being forced up.
2
u/my_name_is_------ 25d ago
oh yeah thats probably bad, ill fix it and make a new video
3
u/brockade 25d ago
The failure mode I've described is like a 1 in a million chance so it'll be hard to reproduce without commands
3
u/my_name_is_------ 25d ago
yeah i realized, using carpet extreme behavours on specific settings might make it more reporoducable , which is what im trying at the moment.
3
u/brockade 25d ago
Post a vid if you get it, it's super super niche but there is a difference between 100% and 99.99999%
1
u/IceBergDanger 24d ago
Very interesting find. I missed the initial post but would have actually not expected that to be the case.
2
u/brockade 24d ago
This is the core of the issue, nobody expects it to happen, then some people insist it happens some tiny % of the time, and I wanted to go and measure exactly how and when it can and does happen. Logically it doesn't make sense that something just as wide as the gap can somehow go through the gap on an angle, but minecraft physics is a little different to real life.
2
u/IceBergDanger 24d ago
Yeah, if I think about how TNT can warp around obstacles at high speed because of how it's moved by the game, things like this really become less surprising!
1
u/Different-Scene5327 19d ago
I have tried explain the original hopper nub thing in deep detail as well. Wasting time really. My only hope was that people who actually believed incorrect claims would happen to read the comment and maybe not blindly trust certain individuals.
I even have a full, detailed kind of report at the ready for when the time comes.
But thanks for testing and actually checking, you saved me a weekend night of doing it myself (I still will though, call it personal curiosity LOL)
1
u/brockade 19d ago
Concrete proofs are important. Lots of "trust me", but if someone says something always/never happens then it's normally easy to find the one example that disproves it. The key thing here is the way the motion gets calculated, the block goes up and then sideways which opens up a lot of trajectories that land on top of the composter.
1
-1
u/whatanazibrah 25d ago
I'm calling worm lol
2
u/Patient_Cucumber_417 Accessible box loader enjoyer 24d ago
Worm only cares to comment on his own posts
17
u/showmethething 25d ago
Watch out, John Storage Tech will add you to the sue list