Minecraft – When player falls while parkouring he gets teleported to certain coordinates

minecraft-java-edition

How can I make it that when a certain player activates this command /execute if entity @a[x=257,y=69,z=-175,dx=11,dz=4] run teleport @p 260 74 -177, he gets teleported but not the other players nearby?

I'm trying to make if the player falls off while parkouring he gets teleported back to the coordinates: 260 74 -177. I don't want to make it so that the player gets killed when he falls I just want him to get teleported to those coordinates.

Because this command teleports the player that is the closest to the command block. I want the command block to teleport the player that executes the command /execute if entity @a[x=257,y=69,z=-175,dx=11,dz=4].

Best Answer

/execute as @a[x=257,y=69,z=-175,dx=11,dz=4] run teleport @s 260 74 -177