如何检测手持物品呢?1.13.2版本,希望大佬能把需要的命令列出来

本帖最后由 无敌三脚猫 于 2022-4-9 11:41 编辑
和上次检测箱子的差不多嘛,不过由于玩家自己就是实体,计分板的分数就不用其它名字,直接存在玩家名下了
而且1.13的execute if score后面是可以用matches的,也就是可以直接判断数字为多少,上次是我低估1.13了,不过这次也用不着matches,可以直接在目标选择器里判断/execute as @p store success score @s shitou run data get entity @s {SelectedItem:{id:"minecraft:stone"}}
/execute as @p[scores={shitou=1}] run say 手里拿着石头
啊等等,1.13的目标选择器有nbt可以用了,那就直接用楼上的吧,用什么计分板,我在想什么
而且1.13的execute if score后面是可以用matches的,也就是可以直接判断数字为多少,上次是我低估1.13了,不过这次也用不着matches,可以直接在目标选择器里判断/execute as @p store success score @s shitou run data get entity @s {SelectedItem:{id:"minecraft:stone"}}
/execute as @p[scores={shitou=1}] run say 手里拿着石头
啊等等,1.13的目标选择器有nbt可以用了,那就直接用楼上的吧,用什么计分板,我在想什么
思考,所以服务器里发手持的都是这样子做的