Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/teleport: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Fix template calls: add MC/ prefix
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
Line 1: Line 1:
{{about|the command in the current version (since Java Edition 1.13 (17w45a))|the command in former game versions|Commands/tp/Before Java Edition 17w45a}}
{{about|the command in the current version (since [[Minecraft:Java Edition 1.13]] ([[Minecraft:Java Edition 1.13|17w45a]]))|the command in former game versions|Commands/tp/Before Java Edition 17w45a}}
{{Infobox command
{{Infobox command
|name=teleport
|name=teleport
|alias={{MC/Cmd|tp|link=none}}
|alias={{cmd|tp|link=none}}
|oplevel=
|oplevel=
* 2 {{only|java|short=1}}
* 2 {{only|java|short=1}}
* 1 {{only|bedrock|short=1}}
* 1 {{only|bedrock|short=1}}
|others=Cheat only{{only|bedrock|short=1}}
|others=[[Minecraft:Cheat]] only{{only|bedrock|short=1}}
}}
}}


Teleports entities (players, mobs, etc.).
Teleports [[Minecraft:entities]] (players, mobs, etc.).


Although most [[Minecraft:commands]] can affect only chunks that have already been generated, {{MC/Cmd|teleport}} can send entities into chunks that have yet to be generated. Right before teleporting, the game generates the destination chunk.
Although most [[Minecraft:commands]] can affect only [[Minecraft:chunk]]s that have already been generated, {{cmd|teleport}} can send entities into chunks that have yet to be generated. Right before teleporting, the game generates the destination chunk.


==Syntax==
==Syntax==
Line 45: Line 45:
==Arguments==
==Arguments==


{{MC/Argument|targets|entity|victim: target|CommandSelector<Actor>}}
{{argument|targets|entity|victim: target|CommandSelector<Actor>}}
: Specifies the entity(s) to be teleported. If not specified, defaults to the command's executor.
: Specifies the entity(s) to be teleported. If not specified, defaults to the command's executor.
: {{MC/Arg desc|je=entity|amount=multiple|type=entities|be=actor}}
: {{arg desc|je=entity|amount=multiple|type=entities|be=actor}}


{{MC/Argument|location|vec3|destination: x y z|CommandPositionFloat}}
{{argument|location|vec3|destination: x y z|CommandPositionFloat}}
: Specifies the coordinates to teleport the target(s) to.
: Specifies the coordinates to teleport the target(s) to.
: {{MC/Arg desc|je=vec3|be=CommandPositionFloat}}
: {{arg desc|je=vec3|be=CommandPositionFloat}}


{{MC/Argument|destination|entity|destination: target|CommandSelector<Actor>}}
{{argument|destination|entity|destination: target|CommandSelector<Actor>}}
: Specifies the entity to teleport the target(s) to.
: Specifies the entity to teleport the target(s) to.
: {{MC/Arg desc|je=entity|amount=single|type=entities|be=actor}}
: {{arg desc|je=entity|amount=single|type=entities|be=actor}}


{{MC/El|je|short=1}}: {{MC/Argument|rotation|rotation}}<br>
{{el|je|short=1}}: {{argument|rotation|rotation}}<br>
{{MC/El|be|short=1}}: {{MC/Argument|be=1|yRot: value|RelativeFloat}} and {{MC/Argument|xRot: value|RelativeFloat}}
{{el|be|short=1}}: {{argument|be=1|yRot: value|RelativeFloat}} and {{argument|xRot: value|RelativeFloat}}
: Specifies the rotation.
: Specifies the rotation.
: {{MC/Arg desc|je=rotation|be=RelativeFloat}}
: {{arg desc|je=rotation|be=RelativeFloat}}


{{MC/Argument|facingLocation|vec3|lookAtPosition: x y z|CommandPositionFloat}}
{{argument|facingLocation|vec3|lookAtPosition: x y z|CommandPositionFloat}}
: Specifies the coordinates to make the target(s) facing to.
: Specifies the coordinates to make the target(s) facing to.
: {{MC/Arg desc|je=vec3|be=CommandPositionFloat}}
: {{arg desc|je=vec3|be=CommandPositionFloat}}


{{MC/Argument|facingEntity|entity|lookAtEntity: target|CommandSelector<Actor>}}
{{argument|facingEntity|entity|lookAtEntity: target|CommandSelector<Actor>}}
: Specifies the entity to make the target(s) facing to.
: Specifies the entity to make the target(s) facing to.
: {{MC/Arg desc|je=entity|amount=multiple|type=entities|be=actor}}
: {{arg desc|je=entity|amount=multiple|type=entities|be=actor}}


{{MC/El|je|short=1}}: {{MC/Argument|facingAnchor|entity_anchor}}
{{el|je|short=1}}: {{argument|facingAnchor|entity_anchor}}
: Specifies whether the entity'eyes or feet to make the target(s) facing to. If not specified, defaults to feet. {{MC/In|java}}, the anchor of the targets can be changed with {{MC/Cmd|execute anchored}}. {{MC/In|bedrock}}, always facing the entity's feet from the targets' feet.
: Specifies whether the entity'eyes or feet to make the target(s) facing to. If not specified, defaults to feet. {{IN|java}}, the anchor of the targets can be changed with {{cmd|execute anchored}}. {{IN|bedrock}}, always facing the entity's feet from the targets' feet.
: {{MC/Arg desc|je=entity_anchor}}
: {{arg desc|je=entity_anchor}}


{{MC/El|be|short=1}}: {{MC/Argument|be=1|checkForBlocks: Boolean|enum}}
{{el|be|short=1}}: {{argument|be=1|checkForBlocks: Boolean|enum}}
: {{MC/Arg desc|be=bool}}
: {{arg desc|be=bool}}
: If set to <code>true</code>, 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). If <code>false</code> or not specified, the default behavior applies (do no check; just teleport the target(s)).
: If set to <code>true</code>, 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). If <code>false</code> or not specified, the default behavior applies (do no check; just teleport the target(s)).


Line 91: Line 91:
==Output==
==Output==


{{MC/Output table}}
{{Output table}}
{{MC/Output table|edition=je|On fail|0|0|0}}
{{Output table|edition=je|On fail|0|0|0}}
{{MC/Output table|On success|1|1|the number of the specified entities }}
{{Output table|On success|1|1|the number of the specified entities }}
{{MC/Output table|edition=be|On fail|0}}
{{Output table|edition=be|On fail|0}}
{{MC/Output table|cmd=/teleport <destination: x y z> ...|On success|1}}
{{Output table|cmd=/teleport <destination: x y z> ...|On success|1}}
{{MC/Output table|cmd=/teleport <victim: target> <destination: x y z> ...|On success|the number of targeted victim entities}}
{{Output table|cmd=/teleport <victim: target> <destination: x y z> ...|On success|the number of targeted victim entities}}
{{MC/Output table|cmd=/teleport <destination: target> ...|On success|2}}
{{Output table|cmd=/teleport <destination: target> ...|On success|2}}
{{MC/Output table|cmd=/teleport <victim: target> <destination: target> ...|On success|the number of victims plus 1}}
{{Output table|cmd=/teleport <victim: target> <destination: target> ...|On success|the number of victims plus 1}}
{{MC/Output table}}
{{Output table}}


==Examples==
==Examples==
Line 126: Line 126:
=== ''Java Edition'' ===
=== ''Java Edition'' ===
{{HistoryTable
{{HistoryTable
|{{MC/HistoryLine|java classic}}
|{{HistoryLine|java classic}}
|{{HistoryLine||0.0.18a|Added {{MC/Cmd|teleport|link=none}}.}}
|{{HistoryLine||0.0.18a|dev=server 1.4|Added {{cmd|teleport|link=none}}.}}
|{{MC/HistoryLine|java indev}}
|{{HistoryLine||0.0.19a_06|dev=server 1.7|Added {{cmd|tp|link=none}} as an alias for {{cmd|teleport|link=none}}.}}
|{{HistoryLine||0.31|dev=20091231-1856|Removed {{MC/Cmd|teleport|link=none}}.{{check version|Was it removed individually in this specific version, or was it no longer able to be used in Indev just like every other command?}}}}
|{{HistoryLine|java indev}}
|{{MC/HistoryLine|java}}
|{{HistoryLine||0.31|dev=20091231-1856|Removed {{cmd|teleport|link=none}}.{{check version|Was it removed individually in this specific version, or was it no longer able to be used in Indev just like every other command?}}}}
|{{HistoryLine||1.10|dev=pre1|Added {{MC/Cmd|teleport|link=none}}, which is like {{MC/Cmd|tp|link=Commands/tp/Before Java Edition 17w45a}}, except that the target parameter is mandatory, the 'teleport to other player' usage is unavailable, and the use of relative coordinates is relative to the executor of the command, rather than relative to the target.}}
|{{HistoryLine|java}}
|{{HistoryLine||1.13|dev=17w45a|{{MC/Cmd|tp|link=none}} is no longer different from {{MC/Cmd|teleport|link=none}} now, and became an alias of {{MC/Cmd|teleport|link=none}}.}}
|{{HistoryLine||1.10|dev=pre1|Added {{cmd|teleport|link=none}}, which is like {{cmd|tp|link=Commands/tp/Before Java Edition 17w45a}}, except that the target parameter is mandatory, the 'teleport to other player' usage is unavailable, and the use of relative coordinates is relative to the executor of the command, rather than relative to the target.}}
|{{HistoryLine|||dev=18w01a|Added <code>facing</code> to {{MC/Cmd|teleport|link=none}}, which causes the target entity to face an entity or a location.}}
|{{HistoryLine||1.13|dev=17w45a|{{cmd|tp|link=none}} is no longer different from {{cmd|teleport|link=none}} now, and became an alias of {{cmd|teleport|link=none}}.}}
|{{HistoryLine|||dev=18w02a|{{MC/Cmd|teleport|link=none}} has been simplified a bit and players can now teleport to entities in other dimensions.}}
|{{HistoryLine|||dev=18w01a|Added <code>facing</code> to {{cmd|teleport|link=none}}, which causes the target entity to face an entity or a location.}}
|{{HistoryLine||1.16|dev=20w06a|{{MC/Cmd|teleport|link=none}} now cannot teleport an entity to a position where <x> or <z> exceeds the range of [-30000000, 30000000), or <y> exceeds the range of [-20000000, 20000000)}}
|{{HistoryLine|||dev=18w02a|{{cmd|teleport|link=none}} has been simplified a bit and players can now teleport to entities in other dimensions.}}
|{{HistoryLine||1.16|dev=20w06a|{{cmd|teleport|link=none}} now cannot teleport an entity to a position where <x> or <z> exceeds the range of [-30000000, 30000000), or <y> exceeds the range of [-20000000, 20000000)}}
}}
}}


=== ''Bedrock Edition'' ===
=== ''Bedrock Edition'' ===
{{HistoryTable
{{HistoryTable
|{{MC/HistoryLine|pocket alpha}}
|{{HistoryLine|pocket alpha}}
|{{HistoryLine||v0.16.0|dev=build 1|Added {{MC/Cmd|teleport|link=none}}.|The coordinates have a maximum of 999,999,999 although it's possible to teleport beyond the maximum by using relative coordinates.}}
|{{HistoryLine||v0.16.0|dev=build 1|Added {{cmd|teleport|link=none}}.|The coordinates have a maximum of 999,999,999 although it's possible to teleport beyond the maximum by using relative coordinates.}}
|{{MC/HistoryLine|bedrock}}
|{{HistoryLine|bedrock}}
|{{HistoryLine||1.2.0|dev=beta 1.2.0.2|Added <code>facing</code> mode.
|{{HistoryLine||1.2.0|dev=beta 1.2.0.2|Added <code>facing</code> mode.
|The maximum coordinates for {{MC/Cmd|teleport|link=none}} have been increased from 999,999,999 to ~3.402824e+38 (2<sup>128</sup>).}}
|The maximum coordinates for {{cmd|teleport|link=none}} have been increased from 999,999,999 to ~3.402824e+38 (2<sup>128</sup>).}}
|{{HistoryLine||1.2.5|dev=beta 1.2.5.15|The maximum coordinates for {{MC/Cmd|teleport|link=none}} have been reduced to 30,000,000.
|{{HistoryLine||1.2.5|dev=beta 1.2.5.15|The maximum coordinates for {{cmd|teleport|link=none}} have been reduced to 30,000,000.
|Attempting to teleport beyond the maximum coordinates no longer outputs an error message.|Exceeding the maximum coordinates is no longer possible.}}
|Attempting to teleport beyond the maximum coordinates no longer outputs an error message.|Exceeding the maximum coordinates is no longer possible.}}
|{{MC/HistoryLine||1.13.0|dev=beta 1.13.0.13|Added <code>checkForBlocks: Boolean</code>.}}
|{{HistoryLine||1.13.0|dev=beta 1.13.0.13|Added <code>checkForBlocks: Boolean</code>.}}
|{{MC/HistoryLine||1.19.40|dev=Preview 1.19.40.23|Players can now teleport to entities in other dimensions, with the "Upcoming Creator Features" experimental toggle enabled.}}
|{{HistoryLine||1.19.40|dev=Preview 1.19.40.23|Players can now teleport to entities in other dimensions, with the "Upcoming Creator Features" experimental toggle enabled.}}
|{{MC/HistoryLine||1.19.50|dev=Preview 1.19.50.23|Teleporting to entities in other dimension no longer requires the "Upcoming Creator Features" experimental toggle to be enabled.}}
|{{HistoryLine||1.19.50|dev=Preview 1.19.50.23|Teleporting to entities in other dimension no longer requires the "Upcoming Creator Features" experimental toggle to be enabled.}}
|{{MC/HistoryLine||1.19.70|dev=Preview 1.19.70.20|Rotation in the teleport command is now relative to the executor of the command instead of the target. Old usage of rotations in commands remain relative to the target mob for backward compatibility.}}
|{{HistoryLine||1.19.70|dev=Preview 1.19.70.20|Rotation in the teleport command is now relative to the executor of the command instead of the target. Old usage of rotations in commands remain relative to the target mob for backward compatibility.}}
}}
}}


Line 158: Line 159:


== Navigation ==
== Navigation ==
{{MC/Navbox commands}}
{{Navbox commands}}


de:Befehl/teleport
[[Minecraft:de:Befehl/teleport]]
es:Comandos/tp
[[Minecraft:es:Comandos/tp]]
ja:コマンド/teleport
[[Minecraft:ja:コマンド/teleport]]
pt:Comandos/teleport
[[Minecraft:pt:Comandos/teleport]]
ru:Команды консоли/teleport
[[Minecraft:ru:Команды консоли/teleport]]
zh:命令/teleport
[[Minecraft:zh:命令/teleport]]

Latest revision as of 11:09, 10 April 2026

Template:Infobox command

Teleports Minecraft:entities (players, mobs, etc.).

Although most Minecraft:commands can affect only Minecraft:chunks that have already been generated, Template:Cmd 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:Argument

Specifies the entity(s) to be teleported. If not specified, defaults to the command's executor.
Template:Arg desc

Template:Argument

Specifies the coordinates to teleport the target(s) to.
Template:Arg desc

Template:Argument

Specifies the entity to teleport the target(s) to.
Template:Arg desc

Template:El: Template:Argument
Template:El: Template:Argument and Template:Argument

Specifies the rotation.
Template:Arg desc

Template:Argument

Specifies the coordinates to make the target(s) facing to.
Template:Arg desc

Template:Argument

Specifies the entity to make the target(s) facing to.
Template:Arg desc

Template:El: Template:Argument

Specifies whether the entity'eyes or feet to make the target(s) facing to. If not specified, defaults to feet. Template:IN, the anchor of the targets can be changed with Template:Cmd. Template:IN, always facing the entity's feet from the targets' feet.
Template:Arg desc

Template:El: Template:Argument

Template:Arg desc
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). If false or 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

Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table

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:
    • To teleport all players to x=84 y=57 z=79 in the End:
    • To teleport Alex to x=251 y=64 z=-160 in the Overworld:
      • execute as Alex in minecraft:overworld run teleport 251 64 -160Template:Only
      • execute as Alex in overworld run teleport 251 64 -160Template:Only

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

External links

Navigation

Template:Navbox commands

Minecraft:de:Befehl/teleport Minecraft:es:Comandos/tp Minecraft:ja:コマンド/teleport Minecraft:pt:Comandos/teleport Minecraft:ru:Команды консоли/teleport Minecraft:zh:命令/teleport