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

Multiple component entries with the same key cause item deletion

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • None
    • 24w09a
    • None
    • Unconfirmed
    • (Unassigned)

      Setup:
      Place down a shulker box and put a diamond sword with sharpness in it.
      Then run the following command:
      /data modify block x y z Items[0].components.enchantments.levels."minecraft:sharpness" set value 1

      What's supposed to happen:

      If the item already has that component, it will overwrite its value, in this case setting the sword's sharpness level to 1.

       

      What happens instead:

      The game tries to add a second component with the same name ("minecraft:sharpness"), causing it to glitch out and remove the item entirely.
      (Edit: Not quite correct. As elaborated in my comment, it's caused by using the flat name instead of using "minecraft:...". For some reason, it's possible to use it for creating a component entry, but not for checking or modifying)

            Unassigned Unassigned
            SilicatYT Silicat Youtube
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: