Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
注册
Advertisement
Disambig gray  本文章介绍的是当前版本的命令(Java版1.13快照17w45a之后)。关于旧版本的命令,请见“命令/tp/Java版17w45a前”。
teleport
别名
  • /tp
需要的权限等级

Java版:2
基岩版:1

限制条件

启用作弊[仅基岩版]

传送实体(玩家、生物等)到指定的地点,并修改其旋转角度。

不像大多数只能影响已经生成的区块的命令,/teleport可以将实体传送到尚未生成的区块中。若被传送的目标是玩家,则传送后玩家所在的区块及附近的区块会自动开始生成。

语法[]

  • Java版
teleport <destination>
teleport <targets> <destination>
将执行者或指定的实体传送到另一个实体所在的位置,并使其旋转角度与该实体一致。
teleport <location>
将执行者传送到指定的坐标,并使其旋转角度与命令执行角度一致。
teleport <targets> <location>
将指定的实体传送到一个确定的坐标位置,但不会修改其旋转角度。
teleport <targets> <location> <rotation>
teleport <targets> <location> facing <facingLocation>
teleport <targets> <location> facing entity <facingEntity> [<facingAnchor>]
将指定的实体传送到一个确定的坐标位置,并使其旋转角度与指定的一致。
  • 基岩版
teleport <destination: target> [checkForBlocks: Boolean]
teleport <victim: target> <destination: target> [checkForBlocks: Boolean]
将执行者或指定的实体传送到另一个实体所在的位置,并使其水平旋转角度与该实体一致,视角水平(垂直旋转角度为零)。
teleport <destination: x y z> [checkForBlocks: Boolean]
teleport <victim: target> <destination: x y z> [checkForBlocks: Boolean]
将指定的实体传送到一个确定的坐标位置,但不会修改其旋转角度。
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]
将指定的实体传送到一个确定的坐标位置,并使其旋转角度与指定的一致。

参数[]

JE<targets>entity
BEvictim: targetCommandSelector<Actor>

指定要被传送的实体。如果未指定,默认为命令执行者。
必须为玩家名、目标选择器或UUID[仅Java版]

JE<location>vec3
BEdestination: x y zCommandPositionFloat

指定要被传送到的坐标。
必须为三维坐标,元素为浮点数。允许波浪号与脱字号标记

JE<destination>entity
BEdestination: targetCommandSelector<Actor>

指定要被传送到的实体。
必须为玩家名、目标选择器或UUID[仅Java版]。在Java版中,目标选择器只允许1个实体。

Java版<rotation>rotation
基岩版yRot: valueRelativeFloatxRot: valueRelativeFloat

指定实体传送后的旋转角度。
必须为两个双精度浮点数[仅Java版]或单精度浮点数[仅基岩版]组成的朝向,分别表示绕Y轴旋转和绕X轴旋转,以度为单位。
  • 绕Y轴旋转时,-180.0表示北,-90.0表示东,0.0表示南,90.0表示西。
  • 绕X轴旋转时,竖直上方为-90.0,至竖直下方90.0。
波浪号将相对于执行者进行旋转。

JE<facingLocation>vec3
BElookAtPosition: x y zCommandPositionFloat

指定实体传送后朝向的坐标。

JE<facingEntity>entity
BElookAtEntity: targetCommandSelector<Actor>

指定实体传送后朝向的实体。
必须为玩家名、目标选择器或UUID[仅Java版]

Java版<facingAnchor>entity_anchor

指定实体传送后应朝向实体的眼睛还是足部。如果未指定,默认为眼睛。在基岩版中,总是朝向眼睛。
必须为eyesfeet

基岩版checkForBlocks: Booleanbool

必须为布尔值(truefalse)。
如果为true,只当目的地没有实体无法存在其中的方块遮挡时,传送才会生效。如果为false或未指定,则不进行该检查,直接进行传送。

效果[]

命令触发条件Java版基岩版
任意参数不正确 无法解析 无法解析
<targets>victim: target未能解析出至少一个实体(指定的玩家必须在线) 执行失败 执行失败
<destination><facingEntity>destination: targetlookAtEntity: target未能解析出单个实体(指定的玩家必须在线)
目的地坐标的<x>或<z>超出[-30000000, 30000000)或<y>超出(-20000000, 20000000] 执行成功
checkForBlocks: Boolean为真且目标位置被阻挡 N/A 执行失败
执行成功时将目标传送至指定位置。

输出[]

命令版本条件成功次数/execute store success .../execute store result ...
任意Java版执行失败000
执行成功11传送的实体数目
任意基岩版执行失败0N/AN/A
/teleport <destination: x y z> ...执行成功1N/AN/A
/teleport <victim: target> <destination: x y z> ...执行成功传送目标的数目N/AN/A
/teleport <destination: target> ...执行成功2N/AN/A
/teleport <victim: target> <destination: target> ...执行成功传送目标的数目+1N/AN/A

示例[]

  • 将执行实体传送到Alice:teleport Alice
  • 将所有玩家传送到执行实体:teleport @a @s
  • 将执行实体传送到x=100z=100的位置,且高于其现在所在位置三格方块:teleport 100 ~3 100
  • 使最近玩家向右转向10度,但不改变他的位置:execute as @p at @s run teleport @s ~ ~ ~ ~10 ~
  • 通过/execute in命令,还可以将实体传送到指定的维度中(如主世界下界末地)。
    • 将执行实体传送到下界中坐标与其目前所在主世界坐标相同的位置(X和Z坐标将自动除以8):
      • execute in minecraft:the_nether run teleport ~ ~ ~[仅Java版]
      • execute in nether run teleport ~ ~ ~[仅基岩版]
    • 将所有玩家传送到末地中x=84y=57z=79的位置:
      • execute as @a in minecraft:the_end run teleport 84 57 79[仅Java版]
      • execute as @a in the_end run teleport 84 57 79[仅基岩版]
    • 将Alice传送到主世界中x=251y=64z=-160的位置:
      • execute as Alice in minecraft:overworld run teleport 251 64 -160[仅Java版]
      • execute as Alice in overworld run teleport 251 64 -160[仅基岩版]

历史[]

Java版
1.10pre1加入了/teleport,其与/tp相似,但/teleport中一定要指定将被传送的实体,而“传送至其他玩家”的用法是不可用的,并且相对坐标的使用是相对于命令的执行位置而言,而不是相对于目标而言。
1.1317w45a/tp现在用法与/teleport没有任何区别,作为/teleport的别名。
18w01a加入了facing模式,用于指定传送后目标的朝向。
18w02a简化了/teleport的语法,并且命令现在能将实体传送至其他维度中。
携带版Alpha
0.16.0build 1加入了/tp
?加入了facing模式。
加入了checkForBlocks: Boolean参数。
基岩版
?/teleport能指定的坐标最大值从999,999,999被缩减为30,000,000。
试图传送到大于最大坐标的位置不再输出一个错误信息。
1.19.401.19.40.23现在开启实验性玩法后,/teleport命令能将实体传送至其他维度中。
1.19.501.19.50.23/teleport命令将实体传送至其他维度的特性不再属于实验性玩法
1.19.701.19.70.20/teleport命令的旋转角度现在相对于命令执行者,而不是目标。

语言

Advertisement