游戏版本1.16.5 检测玩家背包内指定槽位的指定物品
执行以下命令
execute at @a if entity @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:bucket"}]}] run say 1
已知-106b是副手槽位
执行以下命令
execute at @a if entity @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:bucket"}]}] run say 1
已知-106b是副手槽位
楼上已经给你发了图片了。
execute as @a[nbt={Inventory:[{Slot:1b,id:"minecraft:stone",tag:{test:1}}]}] at @s run say 我在1b的位置有个tag为<test:1>的石头
execute as @a[nbt={Inventory:[{Slot:1b,id:"minecraft:stone",tag:{test:1}}]}] at @s run say 我在1b的位置有个tag为<test:1>的石头
