mojira.dev
MC-159785

Cloned block contains same item in memory

The bug

When you use /clone to copy a block entity that has item nbt in its nbt, the reference of that item id will be cloned, so modifying it in one block, will also change the item nbt in the other block.

Note: I tested this on: jukebox, lectern, chest, shulker_box (and from then on assumed this was the case for all block entities)

How to reproduce

# Place shulker box with item
/setblock ~1 ~ ~ minecraft:shulker_box{Items:[{Count:1b,id:"minecraft:dirt",Slot:0b,tag:{display:{Name:'"mc-159785"'}}}]}

# Clone the placed block
/clone ~1 ~ ~ ~1 ~ ~ ~1 ~1 ~

# Remove something from the item of the cloned block
/data remove block ~1 ~1 ~ Items[0].tag.display.Name

→ Both items will now be unnamed

Linked issues

Comments

No comments.

AlexMCool

boq

Confirmed

Normal

Commands

1.14.4, 19w34a, 19w35a, 19w36a

19w37a

Retrieved