Goance


1.怎么检测实体头部/胸部/腿部/脚部穿戴指定物品?
2.怎么让盔甲架面向玩家向后传送?【方向也可能是斜向】
3.怎么把盔甲架的^-1 ^ ^-1 ^1 ^2 ^1填充方块?



这样会有bug


renyunzhong
1.execute as @e[nbt={ArmorItems:[{id:"diamond_chestplate"}]}]
2.execute as @e[type=minecraft:armor_stand,sort=nearest,limit=1] at @s facing entity @p feet run tp ^ ^ ^-1
3.execute at @e[type=minecraft:armor_stand,limit=1,sort=nearest] run fill ^-1 ^ ^-1 ^1 ^2 ^1 glass keep
我测试能正常工作,不知道有什么bug

Goance
renyunzhong 发表于 2021-4-17 10:31
1.execute as @e[nbt={ArmorItems:[{id:"diamond_chestplate"}]}]
2.execute as @e[type=minecraft:armor_s ...

第一个我是想检测指定穿在头部或胸部或腿部或脚部或副手的物品啊【可能是方块】

renyunzhong
Goance 发表于 2021-4-17 23:12
第一个我是想检测指定穿在头部或胸部或腿部或脚部或副手的物品啊【可能是方块】 ...

/execute as @e[type=zombie,nbt={ArmorItems:[{tag:{a:0b}}]}] if data entity @s ArmorItems[2].tag.a run say 1
最多只能到这了,目标选择器+NBT路径

Goance
本帖最后由 Goance 于 2021-4-20 20:33 编辑
renyunzhong 发表于 2021-4-18 06:31
/execute as @e[type=zombie,nbt={ArmorItems:[{tag:{a:0b}}]}] if data entity @s ArmorItems[2].tag.a  ...

emm...我的意思是指定穿戴在头部的物品
头部或胸部或腿部或脚部或副手【并不是五个部位任意中一个,而是指定的啊】


renyunzhong
Goance 发表于 2021-4-20 20:30
emm...我的意思是指定穿戴在头部的物品
头部或胸部或腿部或脚部或副手【并不是五个部位任意中一个,而是指 ...

前面一个的nbt检测特定标签,后面的if data检测盔甲物品那个NBTList中特定位置上的物品是否存在那个特定标签,nbt路径只能判断标签有无但可以指定列表下标(也就是指定盔甲或主副手),而选择器的nbt只能检测列表中是否存在一个满足的nbt而不能指定下标,两个一起使劲,如果盔甲栏中使用的nbt标签没有重复的就不会出问题