mojira.dev
MC-270644

custom_name= are not detected in the execute if command

can detect other NBTS, but the names, descriptions do not
The commands used are

/give @p book[custom_name='{"text":"hello"}'] 1
/execute if entity @p[nbt={SelectedItem:{id:"minecraft:book",count:1,components:{"minecraft:custom_name":'{"text":"hello"}'}}}]

Attachments

Comments 4

Please include all commands used

Per the 23w40a changelog:

Plain-text chat components (text, no sibilings, no stylings) are now always serialized as string

So you need to test for "minecraft:custom_name":'"hello"'

In the future, use /data get to see how NBT looks before writing your tests

doggasaurio

(Unassigned)

Unconfirmed

(Unassigned)

1.20.5 Pre-Release 1

Retrieved