I am trying to make a parkour map and I want to add checkpoints not by killing them, but by detecting when they go below a certain height. I am currently using this command:
/execute @a[r=68] ~ ~ ~ execute @p[y=27,dx=0,dy=0,dz=0] ~ ~ ~ tp @p 271 43 139
which will search for any players at the height of 27 within a radius of 68 and if a player is found, they will be teleported to 271 43 139.
But I found out one problem with this, if I want to make multiple checkpoints then this command block would only work for a certain range of coordinates and only teleport them to one location no matter where they are.
I thought of a solution where I were to have multiple command blocks at exact locations and with an exact radius, it is going to take a long time. So instead of having a radius relative to the command block, is there a way to find an entity according to specific coordinates?