Whenever a /summon command is used to turn a shulker box into a falling block, the game not only spawns the falling block of an empty shulker box, but it also spawns a shulker box item with the old contents inside. That means a new shulker box is created in the process.
How to reproduce:
Place down a white shulker box, and put items inside.
Run the following command while standing on top of it:
/summon falling_block ~ ~-1 ~ {Block:minecraft:white_shulker_box}
A shulker box item with the items inside should have dropped, and the falling block should have landed and placed an empty box.
I'm not sure if this is the intended behavior, but it definitely does not seem right.
What might be the right way to do it is to put the data of the shulker box into the falling block's TileEntityData tag directly and drop no items. Another way might be to simply drop the contents of the box as items, without the box, and let an empty box fall.
Comments 7
Setting time to 0/not setting it, makes the falling sand remove itself if not in the same block, or remove the block it is in if it is the same. It should work correct if it's omitted and spawned in the same block as it represents.
@Grum Why is this a bug?
The player stands on a red Shulker box (for example)
He summons a falling green (for example) Shulker box below him = inside the red box. The lifetime of the falling block is zero ⚠️
The falling block dies
The red box stays the same
I don't understand .. this works as intended
It's a bug bevause the reporter summons a falling white shulker box in a white shulker box, without a time tag.
Because it has no time tag it'll delete itself if it's not in the same block as the Block tag states, however, when it is in the same block, it deletes the block and continues falling instead. It should not drop a block in this progress!
Your example is correct: summoning a green one in a red one deletes the falling block, as it's not the same block, but since the reporter uses the same block for both the falling block and placed block, it should do as I described above.
The fact that the landed shulker box has no content is MC-92781 and WAI.
Affects other blocks like chests as well.
Similar to MC-40380. If I understand it correctly the problem here is the method net.minecraft.block.Block.breakBlock(World, BlockPos, IBlockState)
(which should be called "onBlockRemoved") is called when a block is removed from a chunk, however multiple blocks implement this method in a way that it drops something, while this should probably be done by the net.minecraft.block.Block.dropBlockAsItemWithChance(World, BlockPos, IBlockState, float, int)
method.
Edit: I forgot that chests and shulkerboxes are supposed to drop when destroyed in creative mode. Therefor the breakBlock
method has to be used.
Grum could you please explain why this is WAI?
As far as I know the the behavior that a falling block with Time:0
replaces the block at the same position was added to prevent falling block duplication. If you leave it like this you will run at some point of time in this problem again if you add new types of falling blocks or new functionalities.
Works as intended.
You made a unsuitable setup using two white Shulker boxes (the one placed in the world, and the falling_block one).
What's happening is not what you guessed. I followed your instructions, playing around a little bit.
Everything in this test is dependent on the `Time` tag which is zero by default. If you set it > 0, you will see the Shulker box dropping as an item
(which is normal looking at e.g. sand falling on a torch).
So the block you placed isn't even replaced by falling_sand, thus the content stays.
Try it out with Block:stone etc. first Time:0 then e.g. Time:200