Commands/tp

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

$$ (prior to 1.13), the primary difference between this command and the command is that  uses coordinates relative to the teleported targets, while  uses coordinates relative to the command's execution. $$ and Java Edition 1.13, is merely a synonym for.

Although most commands can affect chunks that have already been generated, 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 are newly generated.


 * Syntax


 * Java Edition


 * Bedrock Edition


 * 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 – an exception to tilde notation's usual rule of being relative to the executor of the command.  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.


 * (BE: checkForBlocks: Boolean) (optional)
 * If set to, teleports the entity only if the entity would not collide with a block it cannot be inside (Note: this allows teleporting into flowers as well as midair). If   or not specified, the default behavior applies (do no check; just teleport the player).


 * 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), if destination player fails to resolve to a single entity (a named player must be online), or if checkForBlocks is   and the destination is obscured. 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 all players to Steve:
 * To teleport all players to the executing player:
 * To teleport the executing entity to X=100 and Z=100, but three blocks above their current position:
 * To rotate the nearest player 10 degrees to the right without changing their position:  (BE:  )
 * When used via the execute command, it can be used to teleport an entity between the Overworld, the Nether and the End:
 * To teleport the executing entity to the same coordinates, but in the Nether:
 * To teleport all players to X=84 Y=57 Z=79 in the End:
 * To teleport Steve to X=251 Y=64 Z=&minus;160 in the Overworld:

History
Befehl/teleport 命令/tp