Minecraft:Commands/teleport
More actions
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
Teleports entities (players, mobs, etc.).
Although most Minecraft:commands can affect only chunks that have already been generated,
- REDIRECT Template:Command
Template:Redr can send entities into chunks that have yet to be generated. Right before teleporting, the game generates the destination chunk.
Syntax
- Java Edition
teleport <destination>teleport <targets> <destination>- Teleports the executor or the specified entity(s) to the position of an entity, and makes its rotation the same as the specified entity's.
teleport <location>- Teleports the executor to a certain position (and changes its rotation to the command's execution rotation).
teleport <targets> <location>- Teleports the entity(s) to a certain position (without changing their rotation).
teleport <targets> <location> <rotation>teleport <targets> <location> facing <facingLocation>teleport <targets> <location> facing entity <facingEntity> [<facingAnchor>]- Teleports the entity(s) to a certain position and changes their rotation to the specified rotation.
- Bedrock Edition
teleport <destination: target>teleport <victim: target> <destination: target> [checkForBlocks: Boolean]- Teleports the executor or the specified entity(s) to the position of an entity, and makes it face horizontally, and make its horizontal rotation the same as the specified entity's.
teleport <destination: x y z> [checkForBlocks: Boolean]teleport <victim: target> <destination: x y z> [checkForBlocks: Boolean]- Teleports the executor or the specified entity(s) to a certain position (without changing its rotation).
teleport <destination: x y z> [yRot: value] [xRot: value] [checkForBlocks: Boolean]teleport <destination: x y z> facing <lookAtPosition: x y z> [checkForBlocks: Boolean]teleport <destination: x y z> facing <lookAtEntity: target> [checkForBlocks: Boolean]teleport <victim: target> <destination: x y z> [yRot: value] [xRot: value] [checkForBlocks: Boolean]teleport <victim: target> <destination: x y z> facing <lookAtPosition: x y z> [checkForBlocks: Boolean]teleport <victim: target> <destination: x y z> facing <lookAtEntity: target> [checkForBlocks: Boolean]- Teleports the executor or the specified entity(s) to a certain position and changes their rotation to the specified rotation.
Arguments
Template:El: <targets>: entity
Template:El: victim: target: CommandSelector<Actor>
- Specifies the entity(s) to be teleported. If not specified, defaults to the command's executor.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|entity}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Template:El: <location>: vec3
Template:El: destination: x y z: CommandPositionFloat
- Specifies the coordinates to teleport the target(s) to.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|vec3}}{{#vardefine:be-arg|vec3}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Template:El: <destination>: entity
Template:El: destination: target: CommandSelector<Actor>
- Specifies the entity to teleport the target(s) to.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|entity}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
- REDIRECT Template:Edition
Template:Rcat: <rotation>: rotation
- REDIRECT Template:Edition
Template:Rcat: yRot: value: RelativeFloat and <xRot: value>: RelativeFloat
- Specifies the rotation.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|rotation}}{{#vardefine:be-arg|relativefloat}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Template:El: <facingLocation>: vec3
Template:El: lookAtPosition: x y z: CommandPositionFloat
- Specifies the coordinates to make the target(s) facing to.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|vec3}}{{#vardefine:be-arg|vec3}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Template:El: <facingEntity>: entity
Template:El: lookAtEntity: target: CommandSelector<Actor>
- Specifies the entity to make the target(s) facing to.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|entity}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
- REDIRECT Template:Edition
Template:Rcat: <facingAnchor>: entity_anchor
- Specifies whether the entity'eyes or feet to make the target(s) facing to. If not specified, defaults to feet. in Template:Editions, the anchor of the targets can be changed with
- REDIRECT Template:Command
Template:Redr. in Template:Editions, always facing the entity's feet from the targets' feet.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity_anchor}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
- REDIRECT Template:Edition
Template:Rcat: checkForBlocks: Boolean: enum
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|bool}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
- If set to
true, teleports the target(s) only if the target(s) would not collide with a block it cannot be inside (Note: this allows teleporting into flowers as well as midair). Iffalseor not specified, the default behavior applies (do no check; just teleport the target(s)).
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of the specified entities }}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/teleport <destination: x y z> ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of targeted victim entities}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/teleport <victim: target> <destination: x y z> ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|2}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/teleport <destination: target> ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of victims plus 1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:commands-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:command-{{#var:commands-num}}|/teleport <victim: target> <destination: target> ...}}{{#vardefine:command-row-{{#var:commands-num}}|1}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
Examples
- To teleport the executing player to Alice:
teleport Alice
- To teleport all players to the executing player:
teleport @a @s
- To teleport the executing player to x=100 and z=100, but three blocks above their current position:
teleport 100 ~3 100 - To teleport the executing player 1 block forward
teleport ^ ^ ^1
- To rotate the nearest player 10 degrees to the right without changing their position:
execute as @p at @s run teleport @s ~ ~ ~ ~10 ~
- When used via the execute command, can teleport between the Overworld, the Nether and the End:
- To teleport the executing player to the same coordinates, but in the Nether:
execute in minecraft:the_nether run teleport ~ ~ ~Template:Onlyexecute in nether run teleport ~ ~ ~Template:Only
- To teleport all players to x=84 y=57 z=79 in the End:
execute as @a in minecraft:the_end run teleport 84 57 79Template:Onlyexecute as @a in the_end run teleport 84 57 79Template:Only
- To teleport Alex to x=251 y=64 z=-160 in the Overworld:
execute as Alex in minecraft:overworld run teleport 251 64 -160Template:Onlyexecute as Alex in overworld run teleport 251 64 -160Template:Only
- To teleport the executing player to the same coordinates, but in the Nether:
History
Java Edition
Bedrock Edition
External links
de:Befehl/teleport es:Comandos/tp ja:コマンド/teleport pt:Comandos/teleport ru:Команды консоли/teleport zh:命令/teleport