Trying to add traps to a maze I'm making and need to use commands to detect for players who stand on specific blocks but when I use /testfor @p [x= , y= , z= ] it ignores the [ ] part and when I add the r= it will detect players who stand on blocks next to the specific coordinates.
How do I detect players at a single block and that one block only? The traps need to be avoidable but I cant add them if players can activate them without touching the specific block
If you would like me to explain any part of that I can. But yeah to answer your question make sure your radius selector is r=0
When the radius is 0 is doesnt work. I set it up to where it would just say hi when it activated and with 0 it wouldn't work and with 1 as radius it would activate before you stepped on the block.
I tried both /testfor and /execute but when I put the radius as 0 it wont work and when it's at 1 it activates before I step on what is supposed to be the trap.
Trying to add traps to a maze I'm making and need to use commands to detect for players who stand on specific blocks but when I use /testfor @p [x= , y= , z= ] it ignores the [ ] part and when I add the r= it will detect players who stand on blocks next to the specific coordinates.
How do I detect players at a single block and that one block only? The traps need to be avoidable but I cant add them if players can activate them without touching the specific block
is it a unique block under them? Also just so you know testfor is useless when you can just do execute
two commands performing
/testfor @p[x=~, y=~, z=~,r=0]
then performing something like
/effect @p[x=~, y=~, z=~,r=0] levitation 10 0 true
is the same as one execute command as like
/execute @p[x=~, y=~, z=~,r=0] ~~~ effect @s levitation 10 0 true
If you would like me to explain any part of that I can. But yeah to answer your question make sure your radius selector is r=0
When the radius is 0 is doesnt work. I set it up to where it would just say hi when it activated and with 0 it wouldn't work and with 1 as radius it would activate before you stepped on the block.
I'm using default blocks.
I tried both /testfor and /execute but when I put the radius as 0 it wont work and when it's at 1 it activates before I step on what is supposed to be the trap.
you could try doing
/execute @p[x=~, y=~, z=~,dy=1] ~~~ effect @s levitation 10 0 true
This works thank you!
Though I had to make the y= 1 block lower so the traps could be avoidable!
How could I add more coordinates? So I could have more than just one block?
How could I add more coordinates? So I could have more than just one block being detected?
Sorry it's been nearly a month. If you haven't found it you would use dx and dy selectors as arguments.
/execute @p[x=~, y=~, z=~,dy=1,dx=1,dy=1] ~~~ effect @s levitation 10 0 true
would do a 2x2x2 cube. You could increase or decrease that area