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

Adding items to a chest via "data modify append" only works with a Slot tag

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • Minecraft 1.14.1
    • None
    • Unconfirmed
    • (Unassigned)

      When using the following command in a command block that has an empty chest on top, it correctly adds a stack of iron ingots.

      /data modify block ~ ~1 ~ Items append value {id:"iron_ingot",Count:64b}

      ACTUAL

      Executing it another time does nothing. The command still outputs "Modified block data of x, y, z".

      I assume that's because items gain a default Slot tag when added to a container, and that is always 1, instead of being incremented to the next free slot.

      This is not a duplicate of MC-150999.

      It's not intuitive that the command requires a Slot tag for every other time. It also doesn't make sense, when using a command named append, which in all other contexts adds an item to the end of a list, whatever it's current size. (same for prepend with the start of the list)

      On top of that, Slot isn't part of the normal Item NBT (e.g. item entities don't have a Slot). It's only a property of containers (or inventories) to give items a temporary and virtual Slot tag When an item is removed from a container, it'll immediately lose the Slot tag.

      EXPECTED

      It should add another stack of iron ingots to the chest (in the next free slot).

            Unassigned Unassigned
            snapy666 Josh Miller
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: