2

I am trying to test for a clown fish in a players hand, and because they don't have their own ID I have to get into data values with /testfor. Here is the command I have, how do I fix it?

/scoreboard players set mookooy dadfish 1 {Inventory:[{id:"minecraft:fish"},{damage:2c}]}
3

Tag names are case-sensitive; it must be "Damage", not "damage". As well, the tag is stored as a short, so you declare a tag as a short by appending the numerical value with an "s" (not a "c"). Finally, you've closed the item data compound and then opened a new one with the Damage tag, when you instead need that tag to be with the fish item:

/scoreboard players set mookooy dadfish 1 {Inventory:[{id:"minecraft:fish",Damage:2s}]}
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.