Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-159785

Cloned block contains same item in memory

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 19w37a
    • 1.14.4, 19w34a, 19w35a, 19w36a
    • None
    • Confirmed
    • Commands
    • Normal

      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

            boq [Mojang] Bartosz Bok
            AlexMCool Alex³
            Votes:
            5 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: