-
Bug
-
Resolution: Fixed
-
Minecraft 1.7.2, Minecraft 14w33a, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.2-pre6, Minecraft 1.8.3, Minecraft 1.8.4, Minecraft 15w35b, Minecraft 15w51b, Minecraft 16w20a, Minecraft 1.10 Pre-Release 1, Minecraft 16w43a, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12 Pre-Release 5, Minecraft 1.12 Pre-Release 6, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w47b, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w06a, Minecraft 18w11a, Minecraft 1.13.1
-
Confirmed
The bug
Replacing heads using the /setblock or /fill command (or /clone move) drops them as items.
Note: For versions >= 17w47 flower pots are no longer affected because they are not using a block entity anymore.
How to reproduce
- Place one of the affected blocks
- Use the following command while standing on them
/setblock ~ ~ ~ air replace
→ The head will still drop as an item, even though the command is set to replace and not destroy
Code analysis
The following is based on a decompiled version of Minecraft 1.9 using MCP 9.24 beta.
For flower pots the reason for this is that they do not implement the interface net.minecraft.inventory.IInventory and therefor the method net.minecraft.inventory.IInventory.clear() does not exist and is not called to clear the contained items.
For skulls the problem is that currently the method net.minecraft.block.BlockSkull.breakBlock(World, BlockPos, IBlockState) drops the skull (should be rather called "onBlockRemoved"). Instead the method net.minecraft.block.BlockSkull.dropBlockAsItemWithChance(World, BlockPos, IBlockState, float, int) should do this. The problem with this is that the former method removes the tile entity first. The order of this should be probably changed.
- is duplicated by
-
MC-40412 SetBlock Command & Skulls
- Resolved
-
MC-77201 Fill and setblock when replacing skulls drops the skull
- Resolved
-
MC-80114 Setblock with flower pot drops the plant inside
- Resolved
-
MC-102104 Structure Block load - Entity issue
- Resolved
-
MC-103044 Skull/Head drop with fill and setblock.
- Resolved
-
MC-123919 Skulls drop when they shouldnt
- Resolved
-
MC-125019 Player Heads
- Resolved
-
MC-128776 Player head drops when setblock replace
- Resolved
-
MC-147420 Cloning a skull to itself duplicates the skull
- Resolved
- relates to
-
MC-138040 Replacing a skull/player_head block using /fill or /setblock no longer drops the skull
- Resolved
-
MC-138067 Replacing filled jukebox drops record
- Resolved