-
Bug
-
Resolution: Fixed
-
Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w47b, Minecraft 1.13.1
-
Confirmed
The bug
Custom names from items can be removed by putting them in an anvil and emptying the name field.
For custom named shulker boxes that were placed down and picked up before that doesn't remove the custom name from the NBT data. This results in them taking their old name again after placing them down.
Steps to reproduce
- Rename a shulker box in an anvil, for example name it "test"
- Place it down and pick it up again
- Put the shulker box in an anvil and empty the name field to rename it to its standard name
- Place the shulker box down
→ It will now be named "test" again. After picking it up the item also has its old name "test"
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The problem seems to be that when the shulker box is broken the name is stored in the CustomName tag of the BlockEntityTag as well, but renaming an item only changes the value of the Name tag in the display tag.
The method net.minecraft.block.BlockShulkerBox.breakBlock(World, BlockPos, IBlockState) currently removes the custom name of the shulker box tile entity to prevent it from being dropped by the method net.minecraft.block.BlockContainer.harvestBlock(World, EntityPlayer, BlockPos, IBlockState, TileEntity, ItemStack) as well.
If the custom name was removed before the NBT data is copied into the BlockEntityTag this bug could be solved too.
- is blocked by
-
MC-124327 Changing the name of an item and then emptying the text field in an anvil doesn't make the rename unavailable, keeps last non-empty name on output item
- Resolved
- is duplicated by
-
MC-119240 Renamed shulker boxes cannot be un-named
- Resolved
-
MC-119885 Shulker Box renames itself back to the previous name
- Resolved
-
MC-120133 Unnamed shulker box gets its previous name after placing
- Resolved
-
MC-120907 Shulker box name rolls back when contents change
- Resolved
- relates to
-
MC-107388 Shulker boxes don't retain custom names when placed or broken
- Resolved
-
MC-141946 Shulker boxes lose their name after being broken
- Resolved