How to test for people standing on a specific block?

How to test for people standing on a specific block? - A Woman Wearing Lab Coat While Holding a Notebook

I'm trying to set up a trap for my friend on my server, I want to use command blocks, not tripwire.

I know the /testfor command, but it always says that it found me and doesn't give another output.



Best Answer

You can do this with the execute command.

  1. Setup a full clock. I recommend the answer to this question if you need to know how.
  2. On one side of that red stone block, put down a new command block with this command in it:

Execute Notch ~ ~ ~ detect ~ ~-1 ~ grass 0 <command>

Replace notch with your friend's name, replace grass with the block name you want him to be standing on, and replace command with the command you want to do.




Pictures about "How to test for people standing on a specific block?"

How to test for people standing on a specific block? - People Wearing Face Mask Inside the Classroom
How to test for people standing on a specific block? - A Man Holding Test Papers Inside the Classroom
How to test for people standing on a specific block? - A Low Angle Shot of a Man Putting Test Paper on the Table



How do you test a player in Minecraft in a certain area?

2. Type 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.


  • How can you tell if a player is on a block in Minecraft?

    Type in \u201c/co inspect\u201d to start the inspector. Then, use the following commands to track who placed or removed blocks on your server: Left-click a block to see which player placed it. Right-click a block to see when an adjacent block was removed.



    How to detect if player are standing on *SPECIFIC BLOCKS* in minecraft bedrock




    More answers regarding how to test for people standing on a specific block?

    Answer 2

    For get an output, you have to put a comparator in front of the command block. When it finds you, the comparator should emit a redstone pulse that will activate whatever you want.

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

    Images: Artem Podrez, Andy Barbour, Andy Barbour, Andy Barbour