1

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.

1 Answer 1

2

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.)

2
  • 1
    Just tested it, works on 1.8.1
    – Vanguard66
    Jan 11, 2015 at 0:31
  • 1.13 syntax: /execute if entity @a[x=0,y=64,z=0,distance=..3,gamemode=survival]
    – pppery
    Aug 11, 2019 at 15:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .