/ execute as @a [nbt = {SelectedItemSlot: 0, Inventory: [{Slot: 0b, id: "minecraft: golden_pickaxe", tag: {display: {Name: "{\" text \ ": \" personal \ " } "}}]}] run say ok
or
/execute as @a[nbt={SelectedItemSlot:0,Inventory:[{Slot:0b,display:{Name:"{\"text\":\"Minero\"}"}}]}] run list uuids
But ...
this command works.
/execute as @a[nbt={SelectedItemSlot:1,Inventory:[{Slot:1b,id:"minecraft:golden_pickaxe"}]}] run list uuids
If I want to search by the name it does not work anymore.
/ execute as @a [nbt = {SelectedItemSlot: 0, Inventory: [{Slot: 0b, id: "minecraft: golden_pickaxe", tag: {display: {Name: "{\" text \ ": \" personal \ " } "}}]}] run say ok
or
/execute as @a[nbt={SelectedItemSlot:0,Inventory:[{Slot:0b,display:{Name:"{\"text\":\"Minero\"}"}}]}] run list uuids
But ...
this command works.
/execute as @a[nbt={SelectedItemSlot:1,Inventory:[{Slot:1b,id:"minecraft:golden_pickaxe"}]}] run list uuids
If I want to search by the name it does not work anymore.
Thanks
I believe SelectedItemSlot is 1-9 instead of 0-8, while it's 0-8 in Slot.
But... here's an easier one:
Try sth like this:
/execute as @a[nbt={SelectedItemSlot:1,SelectedItem:{display:{Name:"{\"text\":\"Minero\"}"}}}] run list uuids
Thanks, I've tried the command that you show me. and I have verified that:
/execute as @a[nbt={SelectedItemSlot:0,SelectedItem:{id:"minecraft:golden_pickaxe"}}] run list uuids It works well, using 0-8 but when you search by name.... display:{Name:"{\"text\":\"Minero\"}"} it no longer works.
unfortunately there is no other way to include the name in a search.
Thanks, I've tried the command that you show me. and I have verified that:
/execute as @a[nbt={SelectedItemSlot:0,SelectedItem:{id:"minecraft:golden_pickaxe"}}] run list uuids It works well, using 0-8 but when you search by name.... display:{Name:"{\"text\":\"Minero\"}"} it no longer works.
unfortunately there is no other way to include the name in a search.
Oh... is it...
But hey, if it's a custom item, use custom tag instead.
e.g. /give @p golden_pickaxe{Blah:1b} 1
Then you can use
/execute as @a[nbt={SelectedItemSlot:0,SelectedItem:{tag:{Blah:1b}}}] run ...
Please help me correct this command.
/ execute as @a [nbt = {SelectedItemSlot: 0, Inventory: [{Slot: 0b, id: "minecraft: golden_pickaxe", tag: {display: {Name: "{\" text \ ": \" personal \ " } "}}]}] run say ok
or
/execute as @a[nbt={SelectedItemSlot:0,Inventory:[{Slot:0b,display:{Name:"{\"text\":\"Minero\"}"}}]}] run list uuids
But ...
this command works.
/execute as @a[nbt={SelectedItemSlot:1,Inventory:[{Slot:1b,id:"minecraft:golden_pickaxe"}]}] run list uuids
If I want to search by the name it does not work anymore.
Thanks
I believe SelectedItemSlot is 1-9 instead of 0-8, while it's 0-8 in Slot.
But... here's an easier one:
Try sth like this:
/execute as @a[nbt={SelectedItemSlot:1,SelectedItem:{display:{Name:"{\"text\":\"Minero\"}"}}}] run list uuids
Hello YMbrothers
Thanks, I've tried the command that you show me. and I have verified that:
/execute as @a[nbt={SelectedItemSlot:0,SelectedItem:{id:"minecraft:golden_pickaxe"}}] run list uuids It works well, using 0-8 but when you search by name.... display:{Name:"{\"text\":\"Minero\"}"} it no longer works.
unfortunately there is no other way to include the name in a search.
Oh... is it...
But hey, if it's a custom item, use custom tag instead.
e.g. /give @p golden_pickaxe{Blah:1b} 1
Then you can use
/execute as @a[nbt={SelectedItemSlot:0,SelectedItem:{tag:{Blah:1b}}}] run ...
thanks for the info. very useful
[/b][/i]