The /item override command, when there are more destination slots than source items, clears the remaining destination slots. This is normal behavior. To borrow the notation used in the 26.3-snapshot-1 changelog:
override [01234] with (ABC)->[ABC__](ABC is copied, and the remaining slots are cleared)
However, when the number of source slots is zero, the command fails and leaves all destination slots unchanged. Although this may be intentional given that it is an edge case, I suspect this behavior is a bug.
X:
override [01234] with ()->[01234](no change)
O:override [01234] with ()->[_____](all slots cleared)
Selecting zero source slots does not necessarily indicate an error that should cause the command to abort. Instead, an empty set of slots may itself be a valid result of the source slot selection. Under that interpretation, the existing behavior would naturally lead to every destination slot being considered a remaining slot, since no source items are copied. Therefore, all destination slots would be cleared, which would also be a reasonable behavior for /item override when the source slot source selects zero slots.
Steps to Reproduce
Place at least two items in any slots of your hotbar. (
/loot replace entity @s hotbar.0 9 loot {pools:[{rolls:1,entries:[{type:tag,items:"#wool"}]}]})Summon a chest minecart. (
/summon chest_minecart)Use
/item overrideto copy all items from the hotbar into the chest minecart, selecting only slots containing at least one item:/item override entity @n[type=chest_minecart] container.* from entity @s {type:filtered,item_filter:{count:{min:1}},slot_source:{type:slot_range,slots:"hotbar.*"}}Remove the items from the first half of your hotbar and run the command again. Observe that the corresponding number of items in the chest minecart are also cleared.
Empty your entire hotbar and run the command once more.
Expected Result
The chest minecart is emptied.
Actual Result
The chest minecart retains the contents it had after Step 4.
Comments 0
No comments.