giving a score to an item with a Damaga value

giving a score to an item with a Damaga value - Photo Of People Exchanging Gift Cards

I am trying to give a score of 1 to isYellowWool, which is a Yellow wool item. I have tried this command:

/scoreboard players set @e[type=Item] isYellowWool 1 {Item:{id:minecraft:wool,Damage:4}}

But it gives me this error:

The dataTag does not match for 598f6a62-8ae2-4c54-b5c4-f26e4ba340f5



Best Answer

Damage is stored as a short, rather than a normal integer. When testing for data tags you need to match the data exactly, including its type. Add s after the number to specify a short:

/scoreboard players set @e[type=Item] isYellowWool 1 {Item:{id:minecraft:wool,Damage:4s}}



Pictures about "giving a score to an item with a Damaga value"

giving a score to an item with a Damaga value - Photo Of People Playing Dreidel On Top Of Glass Table
giving a score to an item with a Damaga value - Free stock photo of 4th of july, achievement, america
giving a score to an item with a Damaga value - Person Holding Gold Round Coin





Problem-Solving Techniques #13: Weighted Scoring Model




More answers regarding giving a score to an item with a Damaga value

Answer 2

The data tag '598f6a62-8ae2-4c54-b5c4-f26e4ba340f5' is probably your tag associated with your username on whatever server you were on. Now, I'm not sure, but I'd say that 'The dataTag does not match for 598f6a62-8ae2-4c54-b5c4-f26e4ba340f5' is a normal error. It just means that whatever data tag you set, may it be 'if any player is holding a stick' or, in your case yellow wool, then do something - which is set the scoreboard value - only, you aren't holding the wool, so the data tag does not match. Try putting your command into a repeat, always active command block then do '/scoreboard players list (Your Username) ' Then check your value for 'isYellowWool'. Then hold yellow wool, and check again. I think it was never broken but I'm not sure.

Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: RODNAE Productions, RODNAE Productions, RODNAE Productions, RODNAE Productions