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