mojira.dev
MC-116449

Cannot Detect Item using /testfor

The command...

/testfor @e[type=Item] {Item:{id:minecraft:nether_star}}

...would ordinarily work, but with the new NBT tag parsing, now I get:

Data tag parsing failed: Expected '}' but got ':' at {Item:{id:minecraft:<--[HERE]

The minecraft: part IS required, since running...

/testfor @e[type=Item] {Item:{id:nether_star}}

...with a nether star item floating nearby fails with...

item.item.netherStar did not match the required data structure

The same goes for other items.

Aaaaand, unfortunately, this breaks a LOT of stuff on my map.

Comments 1

Use

/testfor @e[type=Item] {Item:{id:"minecraft:nether_star"}}

Jason C. McDonald

(Unassigned)

Unconfirmed

Minecraft 17w16a

Retrieved