I'm trying to /testfor a player on a block

I'm trying to /testfor a player on a block - Two Men Playing Volleyball Near Red Canopy

I am trying to make a command block that when a player walks over a block, it will detect the player and activate another command block with a different command. I tried:

/testfor @p {coordinates of the block}

but this doesn't work.



Best Answer

According to this page from the Minecraft wiki, you also need to specify a radius within the block to check for the player.

To count the number of players in survival mode within a 3-block radius of (0,64,0):

testfor @a[0,64,0,r=3,m=0]

(The r= isn't strictly necessary, but it makes the command a little clearer.)




Pictures about "I'm trying to /testfor a player on a block"

I'm trying to /testfor a player on a block - Men Running Playing Football during Daytime
I'm trying to /testfor a player on a block - Brown and White Brick Wall
I'm trying to /testfor a player on a block - White and Brown Brick Wall



How do you Testfor a player on a block?

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.




  • Kendrick Lamar - i (Official Video)




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

    Images: Jim De Ramos, Pixabay, Alex Tepetidis, Alex Tepetidis