I have used the /testfor command a lot but I ran into a problem I thought you could help with.

This is my command:

/testfor @p[r=3] {Inventory:[{id:"minecraft:log",Count:64b}]}

In this command I want it to test for log number 2, which is birch wood, but the thing is I don't know how to insert that.

I want it so it detects if the player has a 64 stack of birch wood.


The Damage tag holds the metadata value. It has a datatype of "short", so you append the value with an "s":

/testfor @p[r=3] {Inventory:[{id:"minecraft:log",Damage:2s,Count:64b}]}
| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.