![]() |
VOOZH | about |
Entity stack separation refers to the process of separating one or more entities out of a stack of aligned entities. It is commonly used in Ender Pearl stasis chambers, tunneling TNT cannons, item sorters, and other machines that work with entities. The concept of stack separation relies on using either the global entity ticking order or the subchunk entity collection order to allow some entities in the stack to move, then change something in the world, and then allow the rest to move differently.
The order in which entities tick is determined by their position in the global entity ticking list. They are added to the list in the order that they begin ticking. Under most circumstances, this means entities tick in the same order they spawn.
One common way to separate entities is to use trapdoors, doors, or fence gates together with pressure plates or tripwire. Then, allowing the stack of entities to move into the pressure plate or tripwire will cause the first entity to activate it, which opens or closes a trapdoor, door, or fence gate, and that changes what the rest of the stack will collide with.
For blocking one entity and allowing the rest through, fence gates are a good option. They are all closed by default. When the first entity ticks, it will hit the side of the first fence gate and then activate the pressure plate and open it. The rest of the entities can go through the open fence gate. This is particularly useful because it can be chained multiple times, which is most commonly used in high speed item sorters.
For allowing one entity through and blocking the rest, trapdoors are a good option. They are all closed by default so entities fit under them. When the first entity ticks, it will go under the first trapdoor and then activate the pressure plate and close it. The rest of the entities are blocked by the trapdoor.
Although it may seem like they would work, weighted pressure plates actually don't work for entity separation purposes. They update their signal strength level in the block tick phase instead of updating it instantly when entities interact with them. To block a specific number of entities, it is necessary to use a "dummy entity".
The strategy is as follows. The dummy entity needs to be outside the stack, and needs to tick between the two groups of entities you wish to separate. Then this is the order:
Another way to separate entities is to use other entities that change the world in some way. These include:
All these entities can be used to separate other entities by having some amount of entities in the stack tick, then modifying the world with one of these special entities, then having the rest of the stack move differently after the modification.
Since boats have a hard hitbox that other boats collide with, stacks of boats have a tendency to separate themselves. This is especially a problem if you want a stack of boats to move quickly and stay in one stack. The first boat moves past all the others, then the second boat hits the back of the first, and so on. For this reason it is not possible for a stack of boats moving further than the width of a boat each tick to stay together.
TNT entities always apply gravity before moving. Because of this, a stack of TNT that is in the air will tend to separate itself vertically. The first TNT entity ticks, moves down due to gravity, explodes below the stack, and accelerates the rest of the stack upwards. The second TNT entity moves up from the velocity it was given, explodes above the stack, and accelerates the rest downwards. This process continues and results in explosions at many different heights. TNT cannoning communities have called this effect "swing" because the explosions alternate between being too high and too low, "swinging" up and down.
This effect happens more generally with any moving stack of TNT. To avoid it, there are a few options:
One common instance of this is allowing some entities to hit the side of a block, then using TNT to break the block, which allows the rest of the entities to go past the block. In particular, the entities being separated can also be TNT entities. This allows long tunnels to be dug in one tick as the TNT separate each other into a line, and is the basis for tunneling TNT cannons.
More complex TNT cannons can use this effect to align TNT. A common pattern is to place blocks in specific places to force TNT to collide with them and move in a specific way, then break the blocks to change the trajectory of the TNT. This can be used to dig arbitrarily large 3D areas in one tick, using the "tunneling" behavior to dig many tunnels next to each other.
Each subchunk keeps a list of entities that are inside it. Entities are added to this list in the order they enter the subchunk, and this is independent of their order in the global ticking list. Entities are collected in the order given by this list when the game tries to find all entities within a given space. In particular this means that moving blocks push entities in this order.
This is commonly used in ender pearl stasis chambers. If you have a stack of ender pearls, you can push it with a piston and use the strategy detailed in the Pressure plates & Tripwire section to split one ender pearl out of the stack.