9999999999999
怎样在某个区域内检测背包特定格子内是否携带了某样物品

Alxeh
execute positioned x y z run execute if entity @a[distance=..10,nbt={Inventory:[{id:"minecraft:xxx",Slot:100b}]}]
命令中Slot的值代表玩家身上的某个物品栏,具体请看图。

Alxeh
本帖最后由 Alxeh 于 2019-2-24 01:00 编辑
Alxeh 发表于 2019-2-24 00:56
execute positioned x y z run execute if entity @a[distance=..10,nbt={Inventory:[{id:"minecraft:xx ...


补充一句,如果需要检测方形区域,那么将positioned后的坐标变为区域角落坐标,distance=..10换做dx=10,dy=10,dz=10(监测10×10×10大小矩形区域)

第一页 上一页 下一页 最后一页