How do I testfor if a player is standing on a certain block on a certain coordinates

So I'm pretty new to testfor still and I would like to know how to create a commandblock system that would detect when they are standing on a yellow wool block on the coordinates 400 4 600 (for example) does anyone know how to setup this redstone suystem, and also be specific about how I set the redstone system up, so for example show me a picture on how the setup of it would look like.


Solution 1:

You'll need a redstone clock with a command block as shown below: How to set up

In the command block add the command /testfor @a[x=400,y=4,z=Z,r=600] and start up your clock. When ever a user is at that location, the red output line as shown in the picture will power. Once they have left the position, the output will power off.

Solution 2:

You can try a command like this:

execute @a[x=400,y=4,z=600] ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 4 [Command]

For [Command], you can do something like scoreboard players set @p dummyobjective 1

Then execute @a[score_dummyobjective_min=1] ~ ~ ~ [command]

But those last two lines are usually only needed if you want to run multiple commands, or to keep track of multiple players.