mojira.dev
MC-106657

Testing for a specific number of an item in an inventory does not work

When you enter the command (while having a wheat in your inventory):
/testfor @p {Inventory:[{id:"minecraft:wheat",Count:1}]}
The command returns:
<@p> did not match the required data structure

What I expected to happen was...:
After following the above procedure, the command should be successful.

What actually happened was...:
Instead, the command returns with <@p> did not match the required data structure.

Steps to Reproduce:
1. Carry wheat
2. Place a command block
3. Place a redstone comparator next to the command block, pointed away from it
4. Enter the command: /testfor @p {Inventory:[{id:"minecraft:wheat",Count:1}]}
5. Activate the command block
6. Review output for command

Comments 1

Use

/testfor @p {Inventory:[{id:"minecraft:wheat",Count:1b}]}

976Altair

(Unassigned)

Unconfirmed

Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a

Retrieved