/execute as @a[scores={right_clicked=1..},nbt={SelectedItem:{tag:{Nagato3:1}}},team=Nagato] run (the skill command)
So I'm trying to make a custom carrot on a stick with a custom name and tag that runs a special skill whenever the owner right clicked. But it seems that the item by the give command doesn't really refer to the item stated in the execute command. Am I doing the nbt tag wrong?
Please helppppppp
P.S. the team command and the scoreboard command have run already
/give @p minecraft:carrot_on_a_stick{display:{Name:'[{"text":"skill1"}]'},{Nagato3}} 1
/execute as @a[scores={right_clicked=1..},nbt={SelectedItem:{tag:{Nagato3:1}}},team=Nagato] run (the skill command)
So I'm trying to make a custom carrot on a stick with a custom name and tag that runs a special skill whenever the owner right clicked. But it seems that the item by the give command doesn't really refer to the item stated in the execute command. Am I doing the nbt tag wrong?
Please helppppppp
P.S. the team command and the scoreboard command have run already
Generate the command with this tool:
https://www.gamergeeks.net/apps/minecraft/give-command-generator
Items in inventories can't have tags. So instead, you can add a custom tag.
Ex. {Naruto:3}
Then you can detect whether the selected item has that custom tag.
[nbt={SelectedItem:{tag:{Naruto:3}}}]
Then the resulting commands would be:
/give @p carrot_on_a_stick{display:{Name:'{"text":"skill1"}'},Naruto:3} 1
/execute as @a[scores={right_clicked=1..},team=Naruto,nbt={SelectedItem:{id:"minecraft:carrot_on_a_stick",Count:1b,tag:{Naruto:3}}}]
~Blue
It works!!!!! Thanks, buddy!
Tho, it's actually "Nagato", the man only with skin and bones.
Trying to make some gravity controlling skills.