
Water stacks evenly, sand is next, soil, and then rock has the highest. Yeah, I set it so each material has a different threshold to be begin falling. For a minute I thought they were all the same consistency but then the water came and whoa! it flows! nice work. If cannotContinueFalling & canBePlaced & (blockPos, this.Juno wrote:This is really good. the sand block with the wrong metadata. It then proceeds to fall down and sets the block as its own color, having deleted The entity deletes the original sand block. 3 - One tick later, the entity is updated. 2 - After the entity has been created, the block is pushed into it with a zero tick. The entity and the block coexist until the next tick. for the metadata changing of FallingBlocks. of the block, and the state of the block does not need to match. The FallingSand entity only checks the type The game here sets the block in the position of the FallingBlock to be a block Ensures that FallingSand may be pushed by pistons. I do not think the bottom part needs to be inside the block, any part should work. I think any collision vertically triggers this.onGround, so it being inside the bounding box is enough for this to be triggered. This.moveEntity(this.motionX, this.motionY, this.motionZ) This was the initial fix for sand generators. If there is no block to be deleted, the FallingSand entity itself is deleted. have been fixed and it is probably impossible to recover the original block or the entity.

Unfortunately, the old fallTime check used to be set at 1 tick. This means that the FallingSand and original block were coexisting. If the FallingSand has not started falling, and it is currently inside the original block, The entity is not yet falling if it is pushed by a piston and then dropped. fallTime = 0 is when the entity has not yet started falling. If currentBlock.getMaterial() = Material.air:

the entity must not keep on falling, because that could result in a dupe/block deletion thing. This is probably a safety check of some sorts. If it currently is inside air, the entity gets killed. This.motionX = this.motionY = this.motionZ = 0 īlock currentBlock = () SummonEntityFallingBlock(world, posX, posY, posZ, blockState): SummonEntityFallingBlock(world, posX + 0.5, posY + 0.5, posZ + 0.5, BlockState(currentPosition)) We used to be able to use TNT to push the FallingSand into a portal. Can also convert sand.įor 1 tick, the sand block and the entity coexists. It then proceeds to fall down and sets the blockįallingSand summoned inside another block causes the block to disappear. The original sand block is pushed on.Įntity is updated one tick later and deletes the sand block. The entity and the block coexist until the next tick.Īfter the entity has been created, the block is pushed into it.
#FALLING SAND 4 CODE#
The FallingBlock entity is updated every tick, and the code is quite interesting, allowing for both metadata changers, and possibly sand duplicators.Įntity is created. If the block is allowed to fall, it summons a FallingSand entity in the exact middle of itself, with the same data as itself. See the commented code for a better explanation.Įvery time a BlockFalling is given a block update, it checks the block below it to determine whether it is allowed to fall or not. In this time, another block may be pushed in, which then gets its metadata changed. When a FallingSand entity is created, the block and the entity coexist for a short while.

FallingBlock duplication using end portals.

FallingSand entities can be changed using its NBT data which can change the look of the block to anything like in SimplySarcs video: Sand generators Using FallingSand entities you can use it for various tasks like invisible walls or just moving a block around visually.
