World_9487
游戏版本1.16.5 检测玩家背包内指定槽位的指定物品
执行以下命令
execute at @a if entity @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:bucket"}]}] run say 1


已知-106b是副手槽位

无敌三脚猫
https://minecraft.fandom.com/zh/wiki/Player.dat%E6%A0%BC%E5%BC%8F

qweasdzxc_haha
楼上已经给你发了图片了。
execute as @a[nbt={Inventory:[{Slot:1b,id:"minecraft:stone",tag:{test:1}}]}] at @s run say 我在1b的位置有个tag为<test:1>的石头