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

Cloned block contains same item in memory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.14.4, 19w34a, 19w35a, 19w36a
    • Fix Version/s: 19w37a
    • Labels:
      None
    • Confirmation Status:
      Confirmed
    • Category:
      Commands
    • Mojang Priority:
      Normal

      Description

      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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                boq [Mojang] Bartosz Bok
                Reporter:
                AlexMCool Alex³
              • Votes:
                5 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  CHK: