1.13版本怎么检测副手
大神请开始你的表演!
大神请开始你的表演!
本帖最后由 aghinouz 于 2018-7-20 22:03 编辑
tag @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone"}]}] add isYou
这个代码的意思是给副手为石头的人添加一个名叫isYou的tag
代码主要部分是检测nbt,也就是红色部分,可根据实际需要进行灵活运用
tag @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone"}]}] add isYou
这个代码的意思是给副手为石头的人添加一个名叫isYou的tag
代码主要部分是检测nbt,也就是红色部分,可根据实际需要进行灵活运用
execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone"}]}] run say offhand
会让所有副手拿着 石头 的玩家说“offhand”,你可以根据需要修改加粗的部分。
请务必注意,写在 id 后的物品 id 必须是包含 minecraft: 的完整 id
会让所有副手拿着 石头 的玩家说“offhand”,你可以根据需要修改加粗的部分。
请务必注意,写在 id 后的物品 id 必须是包含 minecraft: 的完整 id
都可以,怎么给=-=
SPGoding 发表于 2018-7-20 21:58
execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone"}]}] run say offhand
会让所有副手拿着 ...
如果拿的东西有指定名字,lore呢?
本帖最后由 aghinouz 于 2018-7-21 10:29 编辑
名字:
execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone",tag:{display:{Name:"{\"text\":\"123\"}"}}}]}] run say 123
现在不在电脑旁边不方便测试,lore大概是这样:
execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone",tag:{
display:{Name:"{\"text\":\"123\"}",Lore:["{\"text\":\"456\"}","{\"text\":\"789\"}"]}}}]}] run say 123
1909566854 发表于 2018-7-21 08:48
如果拿的东西有指定名字,lore呢?
名字:
execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone",tag:{display:{Name:"{\"text\":\"123\"}"}}}]}] run say 123
现在不在电脑旁边不方便测试,lore大概是这样:
execute as @a[nbt={Inventory:[{Slot:-106b,id:"minecraft:stone",tag:{
display:{Name:"{\"text\":\"123\"}",Lore:["{\"text\":\"456\"}","{\"text\":\"789\"}"]}}}]}] run say 123