Coordinate of player standing on a certain block

Coordinate of player standing on a certain block - Person Holding Black and Green Tennis Racket

I'm building a parkour map where if a player falls on a red wool, that particular player needs to be teleported to the start of that level. The problem is that many players can be playing at the same time, so I cant do @p which will teleport the nearest player. Is there any way to get the coordinates of the player who falls on the red wool so that I can use:

/tp @p[x,y,z,0] X Y Z

Or is there any other way?



Best Answer

Run a execute detect on players standing on red wool in a certain area:

/execute @a[x=<woolX>,y=<woolY>,z=<woolZ>,r=<Range>] ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 14 tp @p <X> <Y> <Z>



Pictures about "Coordinate of player standing on a certain block"

Coordinate of player standing on a certain block - A Man Holding a Golf Club
Coordinate of player standing on a certain block - Young Man Standing by Volleyball Net with Ball in Hands
Coordinate of player standing on a certain block - Back View of Person in Blue Vest Wearing Red Beanie Hat Standing on Curling Rink



How can you tell if a player is standing on a certain block?

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 to detect if player are standing on *SPECIFIC BLOCKS* in minecraft bedrock




    More answers regarding coordinate of player standing on a certain block

    Answer 2

    Simple : /execute @a ~ ~ ~ detect ~ ~-1 ~ wool 14 tp @p <x> <y> <z>

    Those x, y, z coordinates are your start coordinate of each level that you have mentioned.

    Edit: Only thing that came to my mind is:

    /spawnpoint @p
    

    and

    /kill @p
    

    Answer 3

    Set up a command block on a Repeat, Always Active command block then put:

    /execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:wool 14 /tp @p x y z
    

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

    Images: Oliver Sjöström, cottonbro, RODNAE Productions, SHVETS production