Updated:
Basic examples
/tp @p 0 64 0: teleport nearest player to coordinates./tp Steve Alex: teleport one player to another player./tp @a ~ ~10 ~: move all players upward relative to their current position.
Coordinates
Use absolute coordinates for fixed places and relative coordinates with ~ when running commands from a player or command block.
Building a simple warp point
Place an impulse command block next to a button and put this inside. Pressing the button sends the nearest player to the shop, facing west:
/tp @p 120 70 -40 90 0
@p picks the player closest to the command block, which is the one who pressed the button. Make a matching block at the shop to send players back. On a public server, use command blocks or functions like this instead of giving players operator rights.
Example: move three blocks upward
/tp @p ~ ~3 ~The three coordinates represent X, Y and Z. Tilde coordinates are relative to the execution position. In a chat command, that usually means your own position; in a command block it means the command block location. Confirm that the arrival point is free of solid blocks before using this example.
Absolute and relative coordinates
Absolute coordinates are plain numbers, such as /tp @p 100 70 200, while relative coordinates include a tilde. The caret notation (^) uses the local facing direction in commands that support it. Mixing these systems without knowing the execution context is a common source of misplaced teleports.
When teleporting fails
Make sure the target selector matches a player and you have permission to teleport. If you are using a command block, test the coordinates with an impulse block first, not a repeating block. Bedrock Edition can differ in selector and command behavior, so select the correct edition in the TP generator.
Face a direction after teleporting
# Yaw 90, pitch 0: look west, straight ahead
/tp @s 0 64 0 90 0
# Look at a point
/tp @s 0 64 0 facing 10 64 10
# Look at an entity
/tp @s ~ ~ ~ facing entity @e[type=minecraft:villager,limit=1,sort=nearest]
Yaw is the horizontal angle: 0 is south, 90 is west, 180 is north and -90 is east. Pitch is vertical: -90 looks straight up and 90 straight down. Use ~ ~ for the rotation to keep the direction the player already faces.
Teleport to another dimension (Java)
/execute in minecraft:the_nether run tp @s 0 70 0
/execute in minecraft:the_end run tp @s 100 50 0
/execute in minecraft:overworld run tp @s 0 100 0
/tp alone always stays in the current dimension. execute in switches the dimension first. In the Nether, pick a Y below 128 or you may land on the bedrock roof. On Bedrock, use a portal or /execute in nether run tp @s 0 70 0 on versions with the new execute syntax.
Nether and Overworld coordinates
One block in the Nether equals eight in the Overworld. To find the Nether point that matches an Overworld location, divide X and Z by 8; to go back, multiply by 8. Y stays the same.
| Overworld | Nether |
|---|---|
| X 800, Z -1600 | X 100, Z -200 |
| X 2400, Z 400 | X 300, Z 50 |
Gather everyone
# Bring every player to you
/tp @a @s
# Everyone except you
/tp @a[name=!YourName] @s
# Every player to one spot, all facing the stage
/tp @a 0 65 0 facing 0 65 10
Be careful with @e. /tp @e @s also moves dropped items, armor stands and every mob in loaded chunks, which can cause lag and break builds. Add type= and distance= to narrow it.
Bedrock Edition differences
- Bedrock has an extra
checkForBlocksoption:/tp @s 100 64 100 truecancels the teleport if the destination is inside solid blocks. - Selectors use
c=1instead oflimit=1. - Rotation and
facingwork the same way as in Java.