So I'm trying to make a command that tests for a named item in a players inventory, and executes if they have that item. I know that you can test for an item type, but how do I make it test for a name too? Please bear in mind: I am trying to figure this out for Minecraft 1.13, not any previous versions.
*Edit: I have already tried this command with no success:
execute at @a[nbt={Inventory:[{id:"minecraft:blaze_rod",Count:1b,tag:{display:{Name:"{\"text\":\"Doomstick\"}"}}}]}] run say hi
Edit 2: So after some testing I think it has to do with the attribute modifiers or text color I'm using with the name. Any ideas?
SelectedItem
is still notInventory
. "Held item" is a different issue. We may have a duplicate, but "how do I test for an item in a player's hand" is not it. As such I am voting to reopen.testfor
has been removed andscoreboard players tag
has been changed totag
, therefore it is not a duplicate because Warloch is specifically asking about Minecraft 1.13.