Mojira Archive
MC-151711

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

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).

Duplicate

Josh Miller

2019-05-13, 05:56 PM

2019-07-09, 11:57 PM

2019-05-13, 09:06 PM

1

1

Unconfirmed

(Unassigned)

Minecraft 1.14.1

-