mojira.dev
MC-248489

execute with "SelectedItem" selector does not work

/give @p stone{display:{Name:'[{"text":"monkey"}]',Lore:['[{"text":"monkey"}]']}} 1

/execute if entity @a[nbt={SelectedItem:{tag:{display:{Name:"\"monkey\"",Lore:["monkey"]}}}}] run say hi

Attachments

Comments 5

Do /data get entity @s SelectedItem to observe that you are not checking for the data as it appears

i just tried this command to detect the item: /execute if entity @a[nbt={id: "minecraft:stone", Count: 1b, tag: {display: {Lore: ['[

{"text":"monkey"}

]'], Name: '[
{"text":"monkey"}]'}}}] run say hi . as that was wat the "/data get entity @s SelectedItem" gave me. and still does not function.

i have now also tried the same thing in a vanilla environment and it still . does . not . function

Sorry, the bug tracker is not the right place for command block support. Try /r/minecraftcommands

this also only seems to affect new worlds that i have created as older worlds with the same commands alrd in place previously works

sacdj

(Unassigned)

Unconfirmed

(Unassigned)

1.18.1

Retrieved