Commands/tp

From Minecraft Wiki
Jump to: navigation, search

Teleports entities (players, mobs, items, etc.).

In the Java edition, the primary difference between this command and the /teleport command is that /tp uses coordinates relative to the teleported targets, while /teleport uses coordinates relative to the command's execution. In Bedrock Edition, /teleport is merely a synonym for /tp.

Although most commands can only affect chunks that have already been generated, /tp can send entities into chunks that have yet to be generated. If this happens to a player, then the chunks around and including that player's destination will be newly generated.

Syntax
  • Java Edition
tp <destination>
tp <location> [<rotation>]
tp <targets> <destination>
tp <targets> <entity>
tp <targets> <location> facing <facingLocation>
tp <targets> <location> facing entity <facingEntity> [<facingAnchor>]
tp <targets> <location> [<rotation>]
  • Bedrock Edition
tp <destination: x y z> [yRot: value] [xRot: value]
tp <destination: x y z> facing <lookAtPosition: x y z>
tp <destination: x y z> facing <lookAtEntity: target>
tp <victim: target> <destination: x y z> [yRot: value] [xRot: value]
tp <victim: target> <destination: x y z> facing <lookAtPosition: x y z>
tp <victim: target> <destination: x y z> facing <lookAtEntity: target>
tp <destination: target>
tp <victim: target> <destination: target>
Arguments
target player (BE: victim: target) (optional)
Specifies the entity(s) to be teleported. Must be either a player name or a target selector. If not specified, defaults to the player who executed the command. Not optional in command blocks.
destination player (BE: destination: target)
Specifies the entity to teleport the target(s) to. Must be either a player name or a target selector.
x y z (BE: destination: x y z)
Specifies the coordinates to teleport the target(s) to. x and z must fall within the range -30,000,000 to 30,000,000 (exclusive, without the commas), and y must be within the range -4096 to 4096, inclusive. May use tilde notation to specify a position relative to the target's current position‌[Java Edition only] – an exception to tilde notation's usual rule of being relative to the executor of the command. /teleport can be used to teleport relative to executor of the command.
yaw (BE: yRot: value) (optional)
Specifies the horizontal rotation (-180.0 for due north, -90.0 for due east, 0.0 for due south, 90.0 for due west, to 179.9 for just west of due north, before wrapping back around to -180.0). Tilde notation can be used to specify a rotation relative to the target's previous rotation.
pitch (BE: xRot: value) (optional)
Specifies the vertical rotation (-90.0 for straight up to 90.0 for straight down). Tilde notation can be used to specify a rotation relative to the target's previous rotation.
Result
Fails if the arguments are not specified correctly, if target player fails to resolve to one or more entities (named players must be online), or if destination player fails to resolve to a single entity (a named player must be online). Fails individually for each entity referenced by target player that is not in the same dimension as the destination player, if specified.
On success, teleports the targets to the specified destination.
Examples
To teleport yourself to Alice: tp Alice
To teleport all players to yourself: tp @a @p
To teleport yourself to x=100 and z=100, but three blocks above your current position: tp 100 ~3 100
To rotate the nearest player 10 degrees to the right without changing their position: tp @p ~ ~ ~ ~10 ~
When used via the execute command, can teleport between the Overworld, the Nether and the End:
To teleport yourself to the same coordinates, but in the Nether: execute in minecraft:the_nether run tp ~ ~ ~
To teleport all players to x=84 y=57 z=79 in the End: execute as @a in minecraft:the_end run tp 84 57 79
To teleport Alice to x=251 y=64 z=-160 in the Overworld: execute as Alice in minecraft:overworld run tp 251 64 -160

It is impossible, as of yet, to teleport a player or other entity into a different saved world on the singleplayer menu.

History[edit]

Java Edition Classic
0.0.15a (Multiplayer Test 3)Added /tp.
Java Edition Indev
0.31Removed all commands.
Java Edition Alpha
v1.0.16_01Re-added /tp.
Java Edition
1.814w03aAdded rotation arguments to /tp.
1.9.3pre1/tp will no longer teleport the player to a y-coordinate outside the range -512 to 512.
1.1016w21bThe y-coordinate range of /tp is increased to -4096 to 4096.
Pocket Edition Alpha
0.16.0build 1Added /tp.