I have searched everywhere but I can't find the command in 1.12!
I want to make it so when someone picks up lapis lazuli, I get a redstone signal.
I have tried testfor @a {Inventory:{[Id:"minecraft:dye,Damage:4,Count:1"]}}
But all it says is did not match required data structure!
Best Answer
Inventory is a list of compound tags -
[{...},{...},{...},{...}]
. Currently you've got it as a compound tag with a list inside without a key, when everything inside a compound tag requires a key.Fix that to get:
Next,
id
needs a lowercasei
, and its string should just be the item ID;Damage
andCount
are separate tags:Finally,
Damage
andCount
are a short and a byte respectively, rather than both integers. This will be auto-corrected when setting them, but for testing you'll need to specify their type.The full fixed command should be: