How can I specify the data value of an item in a /testfor command? [duplicate]

How can I specify the data value of an item in a /testfor command? [duplicate] - Gold bitcoin coin on background of growth chart

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.






Pictures about "How can I specify the data value of an item in a /testfor command? [duplicate]"

How can I specify the data value of an item in a /testfor command? [duplicate] - Graph of the Movement of the Value of Bitcoin
How can I specify the data value of an item in a /testfor command? [duplicate] - Encyclopedia placed near wooden decorative hand shaped pen holder
How can I specify the data value of an item in a /testfor command? [duplicate] - From above of textbook with exercises and ruler with pens near small case on table



How do I use the Testfor player command?

How to Enter the Command
  • Test if Players are within 10 blocks. In this example, we will test to see if there are any players within a 10 block radius with the following command: /testfor @a[r=10] ...
  • Test if Mooshrooms are within 50 blocks. ...
  • Test if Nearest Player is at Level 20 experience.


  • What replaced the Testfor command?

    The /testfor command became obsolete in Minecraft 1.13, and has been replaced by the /execute command*. It will do the same as typing /testfor @e {SelectedItem:{id:"<item>"}} and then putting a comparator to the command block with the command, and then running the command which you wanna run.



    Minecraft Redstone Tutorial | How to use testfor commands in MCPE!




    Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

    Images: Ivan Babydov, Alesia Kozik, Rachel Claire, Katerina Holmes