Without command blocks you can use the command
/tp <username> ~ ~4 ~
and it will teleport you up 4 blocks relative to your position.
But with command blocks, using the command
will teleport you up for blocks relative to the command block's position.
Is there a way to make it so the command block will teleport you up 4 blocks relative to your position?
Basically, you want the command block to execute the teleport command as if it was the player so for that, you'd use /execute:
execute positioned as <username> run teleport <username> ~ ~4 ~
It works, thank you!
Is there a version of that that works on bedrock edition?
According to the wiki, this should work:
execute <username> ~ ~ ~ teleport <usename> ~ ~4 ~
That said, since I've never played on bedrock, I can't confirm whether this will work the way I intended it to.