Ghost_Last
如题,版本1.13+

xmdhs
@a[nbt={Inventory:[{Slot:-106b,tag:{}}]}]

Ghost_Last
xmdhs 发表于 2020-3-23 17:41
@a[nbt={Inventory:[{Slot:-106b,tag:{}}]}]

格式错误了吧。

Ghost_Last
xmdhs 发表于 2020-3-23 17:41
@a[nbt={Inventory:[{Slot:-106b,tag:{}}]}]

tag为a,物品id为paper

xmdhs
Ghost/残念 发表于 2020-3-23 17:45
tag为a,物品id为paper

?哪里错了,我给你的是选择器

@a[nbt={Inventory:[{Slot:-106b,tag:{a:1b}}]}]

Ghost_Last
xmdhs 发表于 2020-3-23 17:47
?哪里错了,我给你的是选择器

@a[nbt={Inventory:[{Slot:-106b,tag:{a:1b}}]}]

还要加个1b啊。。。行

xmdhs
Ghost/残念 发表于 2020-3-23 17:48
还要加个1b啊。。。行

自定义 nbt 也要按照格式来啊。

获得这个物品的话,这样 /give @s paper{a:1b}

GrizzzKap
/scoreboard players tag @a remove selected
/scoreboard players tag @a add selected {Inventory:[{Slot:-106b,id:"minecraft:diamond_sword"}]}
say @a[tag=selected] 副手是钻石剑

GrizzzKap
不好意思 补充一下 出处
https://www.mcbbs.net/thread-888951-1-1.html

JMBishark
/scoreboard players tag @a remove selected

/scoreboard players tag @a add selected {Inventory:[{Slot:-106b,id:"物品id"}]}
/检测指令

/后续触发