mojira.dev
MC-72691

Can't Testfor With Specific NBT Tags

When I do this command:

/testfor @e[type=Item,r=10] {Item:{id:"minecraft:stone"}}

And I drop a piece of stone, it finds the item, and outputs a comparator signal. But when I do THIS command:

/testfor @e[type=Item,r=10] {Item:{id:"minecraft:stone",display:{Name:"Stone Block"}}}

Or this one:

/testfor @e[type=Item,r=10] {Item:{id:"minecraft:stone",display:{Name:"StoneBlock"}}}

They both fail. I'm assuming it fails with all display tags, and certain other tags which I have not found, but I am not happy about this bug. It has been known for quite a while, and no one has fixed it. It's important to me that this is fixed, and I bet it is important to others too. I can't complete the map I'm building without being able to test for dropped items with a special display name.

Linked issues

Comments 1

Quote from MC-48534:

You will need to add the display inside the 'tag' tag:

testfor @p {Inventory:[{id:<id>, tag:{display:{Name:<name>, Lore:[<lore>]}}}]}

Not a Bug

redstonefreak589

(Unassigned)

Unconfirmed

Minecraft 1.8

Retrieved