mojira.dev
MC-53914

NBT specifier doesn't work with damage values

I tried to make it so every spawn egg with a certain damage value would get /kill'ed, but when I specify the damage value, the command doesn't recognise them, and just say:

[20:08:54] The dataTag does not match for 0e45e872-0af6-4bee-90c3-becbd1309f37

These are the commands I used:

/scoreboard objectives add incinerate dummy
/scoreboard players set @e[type=Item,r=10] incinerate 1 {damage:50,Item:{id:minecraft:spawn_egg}}

When I remove the "damage:1" part, it works just fine, so I think it's a bug. I even changed it to "Damage:1" instead of "damage:1" and checked the wiki to make sure.

Comments 13

you should use:
/scoreboard players set @e[type=Item,r=10] incinerate 1 {Item:{id:"minecraft:spawn_egg",damage:50s}}

First of all, the @e selector got addad in 14w02a, so 1.7.9 can't be affected.
The Data Tag you try to match is the one of the Item Entity in your world. That means you can't directly match {damage:50,Item:{id:minecraft:spawn_egg}} because that's the Data Tag of the Item. instead you have to match it with {Item:{damage:50,id:minecraft:spawn_egg}}. But I tried that and without the Damage part it worked fine for me and with the Damage:50 in there it didn't.

the damage tag requireds an s behind it so damage:50s

I tried it with the s behind and didn't work either.

Isn't the damage value limited to 4 bit = 0..15 ?

3 more comments

@Lukas Fischer, Steven Verberne: Ok, thanks.

The location of the individual Tags in the JSON syntax doesn't matter, I just tried "/scoreboard players set @e[type=Item,r=10] incinerate 1 {Item:{Damage:50s,id:"minecraft:spawn_egg"}}" and it worked too. I just didn't capitalise the Damage and forgot the s.

I meant you had it like {Damage:50,Item:{}}
you had to have {Item:{Damage:50}}

No I think I had the Damage Tag in the Item Compound, I just wrote it as damage. But I don't know anymore, I destroyed that command block a while ago.

Thanks for the help! I didn't know I had to tell it "damage" is a short. But I messed up the command in the description, the command I used in-game has everything in the right place.

wessltov

(Unassigned)

Unconfirmed

Minecraft 14w17a

Retrieved