1.12.2检测盔甲架是否持有指定NBT物体,能实现吗
/scoreboard players tag @e[type=armor_stand] add a {HandItems:[{id:"minecraft:stone"}]}
/execute @e[tag=a] ~ ~ ~ say 手握着石头
/execute @e[tag=a] ~ ~ ~ say 手握着石头
/testfor @e[type=armor_stand] {SelectedItem:{id:"minecraft:grass",Count:1b,tag:{display:{Name:"泥土"}}}}
检测有没有盔甲架拿着一个叫泥土的草方块
检测有没有盔甲架拿着一个叫泥土的草方块
可以,比如检测盔甲架是否手持有SMFXtag的物品,就可以
testfor @e[type=armor_stand] {SelectedItem:{tag:{Tags:["SMFX"]}}}如果你想对该盔甲架再进行操作,可以给他个tag,比如
scoreboard players tag add @e[type=armor_stand] Aezning {SelectedItem:{tag:{Tags:["SMFX"]}}}
要是再想对该实体进行操作时,选择器可以直接写
@e[type=armor_stand,tag=Aezning]
testfor @e[type=armor_stand] {SelectedItem:{tag:{Tags:["SMFX"]}}}如果你想对该盔甲架再进行操作,可以给他个tag,比如
scoreboard players tag add @e[type=armor_stand] Aezning {SelectedItem:{tag:{Tags:["SMFX"]}}}
要是再想对该实体进行操作时,选择器可以直接写
@e[type=armor_stand,tag=Aezning]
本帖最后由 benyu 于 2020-5-4 15:43 编辑
之前在外边,还没看行不行就设置了最佳回答。今天我去试了下,好像不行啊。我把“{tag:……}”这一串改成了display:{name:“”}连名字中的颜色代码都一样,还是显示不符,是为什么?需要检测的东西:
我写的指令:
天佑酱 发表于 2020-5-1 22:43
可以,比如检测盔甲架是否手持有SMFXtag的物品,就可以
testfor @e[type=armor_stand] {SelectedItem:{tag: ...

我写的指令:

benyu 发表于 2020-5-4 15:42
之前在外边,还没看行不行就设置了最佳回答。今天我去试了下,好像不行啊。我把“{tag:……}”这一串改成 ...
你这是1.12.2吗
下面应该是
{SelectedItem:{tag:{display:{Name:"生猪排"}}}}
本帖最后由 benyu 于 2020-5-4 22:15 编辑
是的,谢谢还是不行啊……
是的,谢谢还是不行啊……

