Minecraft:Commands/teleport: Difference between revisions
More actions
Fix template calls: add MC/ prefix |
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={{ | |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 | 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== | ||
{{ | {{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. | ||
: {{ | : {{arg desc|je=entity|amount=multiple|type=entities|be=actor}} | ||
{{ | {{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. | ||
: {{ | : {{arg desc|je=vec3|be=CommandPositionFloat}} | ||
{{ | {{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. | ||
: {{ | : {{arg desc|je=entity|amount=single|type=entities|be=actor}} | ||
{{ | {{el|je|short=1}}: {{argument|rotation|rotation}}<br> | ||
{{ | {{el|be|short=1}}: {{argument|be=1|yRot: value|RelativeFloat}} and {{argument|xRot: value|RelativeFloat}} | ||
: Specifies the rotation. | : Specifies the rotation. | ||
: {{ | : {{arg desc|je=rotation|be=RelativeFloat}} | ||
{{ | {{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. | ||
: {{ | : {{arg desc|je=vec3|be=CommandPositionFloat}} | ||
{{ | {{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. | ||
: {{ | : {{arg desc|je=entity|amount=multiple|type=entities|be=actor}} | ||
{{ | {{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. {{ | : 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. | ||
: {{ | : {{arg desc|je=entity_anchor}} | ||
{{ | {{el|be|short=1}}: {{argument|be=1|checkForBlocks: Boolean|enum}} | ||
: {{ | : {{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== | ||
{{ | {{Output table}} | ||
{{ | {{Output table|edition=je|On fail|0|0|0}} | ||
{{ | {{Output table|On success|1|1|the number of the specified entities }} | ||
{{ | {{Output table|edition=be|On fail|0}} | ||
{{ | {{Output table|cmd=/teleport <destination: x y z> ...|On success|1}} | ||
{{ | {{Output table|cmd=/teleport <victim: target> <destination: x y z> ...|On success|the number of targeted victim entities}} | ||
{{ | {{Output table|cmd=/teleport <destination: target> ...|On success|2}} | ||
{{ | {{Output table|cmd=/teleport <victim: target> <destination: target> ...|On success|the number of victims plus 1}} | ||
{{ | {{Output table}} | ||
==Examples== | ==Examples== | ||
| Line 126: | Line 126: | ||
=== ''Java Edition'' === | === ''Java Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{ | |{{HistoryLine|java classic}} | ||
|{{HistoryLine||0.0.18a|Added {{ | |{{HistoryLine||0.0.18a|dev=server 1.4|Added {{cmd|teleport|link=none}}.}} | ||
|{{ | |{{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 {{ | |{{HistoryLine|java indev}} | ||
|{{ | |{{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 {{ | |{{HistoryLine|java}} | ||
|{{HistoryLine||1.13|dev=17w45a|{{ | |{{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 {{ | |{{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|{{ | |{{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|{{ | |{{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 | ||
|{{ | |{{HistoryLine|pocket alpha}} | ||
|{{HistoryLine||v0.16.0|dev=build 1|Added {{ | |{{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.}} | ||
|{{ | |{{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 {{ | |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 {{ | |{{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.}} | ||
|{{ | |{{HistoryLine||1.13.0|dev=beta 1.13.0.13|Added <code>checkForBlocks: Boolean</code>.}} | ||
|{{ | |{{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.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.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 == | ||
{{ | {{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
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
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
- Specifies the entity(s) to be teleported. If not specified, defaults to the command's executor.
- Template:Arg desc
- Specifies the coordinates to teleport the target(s) to.
- Template:Arg desc
- 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
- Specifies the coordinates to make the target(s) facing to.
- Template:Arg desc
- 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). 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
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:
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
Minecraft:de:Befehl/teleport Minecraft:es:Comandos/tp Minecraft:ja:コマンド/teleport Minecraft:pt:Comandos/teleport Minecraft:ru:Команды консоли/teleport Minecraft:zh:命令/teleport