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

/data modify doesn't create a list item if it can't find any

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • Minecraft 18w43c
    • Confirmed

      The bug

      When you use `/data modify` and it doesn't find the thing specified in the path, it creates that tag. However, if that path contains a list (that doesn't exist) with an index, it doesn't create the list.

      How to reproduce

      1. Set a chest with an item
        /setblock ~1 ~ ~ minecraft:chest{Items:[{Slot:0b,Count:1b,id:"minecraft:dirt"}]}
        
      2. Try to give the item lore by `set`ting `Lore[0]`, this fails because the `Lore` list doesn't exist
        /data modify block ~1 ~ ~ Items[0].tag.display.Lore[0] set value "\"hi\""
        

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

              Created:
              Updated:
              Resolved:
              CHK: