1
Player block detection
I know this has probably been answered sooo many times but I was wondering how I could make with commandblocks so when I stand on for example stone it gives an output. I have seen many videos and things but can never get it to work
Create an account or sign in to comment.
4
1
try this:
/execute @a ~ ~ ~ detect ~ ~-1 ~ stone 0 <command>
this is for 1.8 and what this command does is testing for every player in the world and execute the command on all of them if they are 1 block above stone (so they are standing on a stone block). then you will have to type the command you want to be executed instead of the <command> thingies.
exemple
/execute @a ~ ~ ~ detect ~ ~-1 ~ stone 0 give @p[c=1] dirt 1 0
this gives every player standing on stone a dirt block
/execute @a ~ ~ ~ detect ~ ~-1 ~ stone 0 <command>
this is for 1.8 and what this command does is testing for every player in the world and execute the command on all of them if they are 1 block above stone (so they are standing on a stone block). then you will have to type the command you want to be executed instead of the <command> thingies.
exemple
/execute @a ~ ~ ~ detect ~ ~-1 ~ stone 0 give @p[c=1] dirt 1 0
this gives every player standing on stone a dirt block
1
what does the ~ ~ ~ at the start stand for? and do i need to hook it up to a clock?
1
The ~ ~ ~ is relative coordinates. It's just saying to make the detect command happen at the same block as the player, instead of above them or at a set location. Yes, it will have to be put on a clock ^^
1
hmm thanks but its still not working, can u put the EXACT command for when I stand on dirt it sets a redstoneblock 5 blocks under the commandblock. Maybe im just being annoying i just want it to work
edit: nevermind Stupid me forgot to put in "redstoneblock" after the coordinates... thanks so much for the detailed explanation
edit: nevermind Stupid me forgot to put in "redstoneblock" after the coordinates... thanks so much for the detailed explanation