Minecraft – How to teleport a player to a location relative to another player

minecraft-commandsminecraft-java-edition

I want to teleport a player to a location relative to another. For example, I might want to teleport Steve so that he's exactly 50 blocks on top of Joe.

I can't use /tp, since that will teleport Steve directly onto Joe's location. Is there a way I can teleport someone to somebody else's location, but with an offset? I'd like to do this with a single command, if possible.

Best Answer

The /tp command accepts relative arguments (~), but you won't be able to do it in a single command. You may wish to use a pair of command blocks to execute them quickly and more or less seamlessly.

The following will teleport Steve to Joe, then zero blocks forward (in the x direction), fifty blocks up (in the y direction), and zero blocks to the side (in the z direction).

/tp Steve Joe
/tp Steve ~ ~50 ~

The format is as follows:

 /tp [player] <x> <y> <z> [<y-rot> <x-rot>]

More information can be found on the Official Minecraft wiki: http://minecraft.gamepedia.com/Commands#teleport