Mojira Archive
MC-220040

Execute unless entity selector nbt inventory slot bug

I want to dectect if a player got empty slot 9 if true give an arrow.

I use the following command on a repeating command block :

/execute unless entity @p[nbt={Inventory:[{id:"minecraft:arrow",Slot:9b,Count:1b,tag:{display:{Name:"

{\"text\":\"arrow\"}

"}}}]}] run item replace entity @p container.9 minecraft:arrow{display:{Name:"

{\"text\":\"arrow\"}

"}}

 

The command work, but there is a bug, when i SHIFT+ Right Clic on the arrow to place in active slot form 0-8, the arrow is placed on slot but there is no new arrow placed on the slot 9 (at the 2nd time, the first works). I have to place new item on slot 9 to refresh and an new arrow is placed on slot 9.

But when i Right clic on slot 9 arrow to place it on an other slot, there is a new arrow placed on the 9 slot. So i think this is a bug.

I tried to remove tags but it's the same problem. I'm on a solo creative world.

Edit : command update to 1.17

Duplicate

Foucault Yoann

2021-03-18, 07:02 PM

2023-03-21, 03:28 PM

2023-03-21, 03:23 PM

0

4

Unconfirmed

(Unassigned)

command, item

1.16.5, 1.17, 1.17.1 Pre-release 3, 1.17.1

-