1
Command help
I can't figure out why this command won't work can anyone help I'm on Java 1.16. I have tried both these commands and Other than other minor tweaks I have no idea what to do. I want it to run a command when a blaze rod named "BlockKey" is in the players inventory in any slot and the player has slot 0 selected with no item in it. (or any random item as long as it works without anything.)
execute as @a if entity @a[nbt={Inventory:{Item:{id:"blaze_rod",tag:{Name:"BlockKey"}}}SelectedItemSlot:0}] run summon minecraft:bat ~ ~ ~
execute as @a if entity @a[nbt={Inventory:{Item:{id:"blaze_rod",tag:{Name:"\"BlockKey\""}}}SelectedItemSlot:0}] run summon minecraft:bat ~ ~ ~
execute as @a if entity @a[nbt={Inventory:{Item:{id:"blaze_rod",tag:{Name:"BlockKey"}}}SelectedItemSlot:0}] run summon minecraft:bat ~ ~ ~
execute as @a if entity @a[nbt={Inventory:{Item:{id:"blaze_rod",tag:{Name:"\"BlockKey\""}}}SelectedItemSlot:0}] run summon minecraft:bat ~ ~ ~
2
execute as @a[nbt={SelectedItemSlot:0,Inventory:[{id:"minecraft:blaze_rod",tag:{display:{Name:'{"text":"BlockKey"}'}}}]}] run say wow!
Thanks! I got it to work after I used your command and realised I couldn't use the blaze_rod given by the command :
/give @p minecraft:blaze_rod{display:{Name:"\"BlockKey\""}}
I assume this has to do with the wrong syntax of the name
/give @p minecraft:blaze_rod{display:{Name:"\"BlockKey\""}}
I assume this has to do with the wrong syntax of the name
