指令/teleport
本條目介紹的是目前版本的指令(Java版1.13快照17w45a之後)。關於舊版本的指令,請見「指令/tp/Java版17w45a前」。
teleport
別名
/tp
需要的權限等級
Java版:2基岩版:1
限制條件
啟用作弊[僅基岩版]
傳送實體(玩家、生物等)到指定的地點,並修改其旋轉角度。
不像大多數只能影響已經生成的區塊的指令,/teleport可以將實體傳送到尚未生成的區塊中,傳送前遊戲會生成目標位置所在區塊。
若一個騎乘著礦車、船或其他生物的生物被/teleport傳送,則騎乘者會從其載具上脫離,並被單獨傳送至目標位置,而原有的載具會留在原地,不受影響。反之,若一個正被生物騎乘的礦車、船或生物被/teleport傳送,騎乘在載具上的生物會跟隨載具一同被傳送至目標,並保持騎乘狀態。
目次
1 語法
2 參數
3 結果
4 輸出
5 示例
6 歷史
7 導覽
語法[編輯 | 編輯原始碼]
Java版
teleport
teleport
將執行者或指定的實體傳送到另一個實體所在的位置,並使其旋轉角度與該實體一致。
teleport
將執行者傳送到指定的座標,並使其旋轉角度與指令執行角度一致。
teleport
將指定的實體傳送到一個確定的座標位置,但不會修改其旋轉角度。
teleport
teleport
teleport
將指定的實體傳送到一個確定的座標位置,並使其旋轉角度與指定的一致。
基岩版
teleport
teleport
將執行者或指定的實體傳送到另一個實體所在的位置,並使其水平旋轉角度與該實體一致,視角水平(垂直旋轉角度為零)。
teleport
teleport
將指定的實體傳送到一個確定的座標位置,但不會修改其旋轉角度。
teleport
teleport
teleport
teleport
teleport
teleport
將指定的實體傳送到一個確定的座標位置,並使其旋轉角度與指定的一致。
參數[編輯 | 編輯原始碼]
JE:
指定要被傳送的實體。如果未指定,預設為指令執行者。
必須為玩家名、目標選擇器或UUID[僅Java版]。
JE:
指定要被傳送到的座標。
必須為三維座標,元素為倍精度[僅Java版]或單精度[僅基岩版]浮點數。允許相對座標(~ ~ ~)或局部座標(^ ^ ^)。
JE:
指定要被傳送到的實體。
必須為玩家名、目標選擇器或UUID[僅Java版]。在Java版中,目標選擇器必須為單一數量,否則此指令將無法解析。
JE:
BE:yRot: value:RelativeFloat、xRot: value:RelativeFloat
指定實體傳送後的旋轉角度。
必須由兩個倍精度浮點數[僅Java版]或單精度浮點數[僅基岩版]組成,分別表示繞Y軸旋轉和繞X軸旋轉,以度為單位。分別對應實體資料Rotation的兩個元素。繞Y軸旋轉時,-180.0表示北,-90.0表示東,0.0表示南,90.0表示西。繞X軸旋轉時,豎直上方為-90.0,至豎直下方90.0。加上波浪號前綴將相對於執行朝向進行旋轉。
JE:
指定實體傳送後朝向的座標。
必須為三維座標,元素為倍精度[僅Java版]或單精度[僅基岩版]浮點數。允許相對座標(~ ~ ~)或局部座標(^ ^ ^)。
JE:
指定實體傳送後朝向的實體。
必須為玩家名、目標選擇器或UUID[僅Java版]。
JE:
指定實體傳送後應朝向實體的眼睛還是足部。如果未指定,預設為眼睛。在基岩版中,總是朝向眼睛。
必須為實體錨點(eyes或feet)。代表一個對某輸入向量的變換,無法單獨對執行位置產生影響。對於輸入向量(x,y,z),將按照下述規則變換:若為eyes,則變換為(x,y+eyeHeight,z),其中eyeHeight代表實體的眼睛高度。若為feet,則變換為(x,y,z)(不變)。
BE:checkForBlocks: Boolean:enum
必須為 布林值(true或false)。
如果為true,只當目的地不會被方塊碰撞箱阻擋時,傳送才會生效。如果為false或未指定,則不進行該檢查,直接進行傳送。
結果[編輯 | 編輯原始碼]
指令觸發條件Java版基岩版
任意指令不完整或參數未正確指定 無法解析 無法解析
目的地座標的
checkForBlocks: Boolean為true且目標位置被方塊阻擋 N/A 執行失敗
不符合以上所有條件執行成功
輸出[編輯 | 編輯原始碼]
指令版本條件成功次數/execute store success .../execute store result ...
任意Java版執行失敗000
執行成功11傳送的實體數目
任意基岩版執行失敗0N/AN/A
/teleport
/teleport
/teleport
/teleport
示例[編輯 | 編輯原始碼]
將執行實體傳送到Alice:teleport Alice
將所有玩家傳送到指令執行實體:teleport @a @s
將執行實體傳送到x=100、z=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=84、y=57、z=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=251、y=64、z=-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的語法,並且指令現在能將實體傳送至其他維度中。1.1620w06a/teleport現在當目的地座標的
導覽[編輯 | 編輯原始碼]
閱
論
編指令
目前可用
clear
clone
damage
deop
difficulty
effect
enchant
execute
experience
xp
fill
function
gamemode
gamerule
give
help
kick
kill
list
locate
loot
me
op
particle
place
playsound
recipe
reload
ride
say
schedule
scoreboard
setblock
setworldspawn
spawnpoint
spreadplayers
stop
stopsound
summon
tag
msg
tell
w
tellraw
time
title
teleport
tp
transfer
weather
whitelist
僅Java版
advancement
attribute
ban
ban-ip
banlist
bossbar
chase
data
datapack
debug
debugconfig
debugmobspawning
debugpath
defaultgamemode
dialog
fetchprofile
fillbiome
forceload
item
jfr
pardon
pardon-ip
perf
publish
raid
random
return
rotate
save-all
save-off
save-on
seed
serverpack
setidletimeout
spawn_armor_trims
spectate
stopwatch[新增:JE 1.21.11]
team
teammsg
tm
test
tick
trigger
version
warden_spawn_tracker
waypoint
worldborder
僅基岩版
allowlist
changesetting
clearrealmevents
gametips
project
reloadconfig
reloadpacketlimitconfig
save
sendshowstoreoffer
僅教育版
classroommode
code
getchunkdata
getchunks
geteduclientinfo
geteduserverinfo
getspawnpoint
globalpause
resourceuri
takepicture
基岩版和教育版
?
ability
agent
aimassist
camera
camerashake
clearspawnpoint
closewebsocket
codebuilder_actorinfo
controlscheme
daylock
alwaysday
dedicatedwsserver
dialogue
enableencryption
event
fog
gametest
gettopsolidblock
hud
immutableworld
inputpermission
listd
mobevent
music
permission
ops
playanimation
querytarget
replaceitem
script
scriptevent
setmaxplayers
structure
testfor
testforblock
testforblocks
tickingarea
titleraw
toggledownfall
worldbuilder
wsserver
connect
已移除
placefeature
僅Java版
?
achievement
banip
blockdata
broadcast
entitydata
home
iron
locatebiome
replaceitem
setspawn
solid
stats
toggledownfall
testfor
testforblock
testforblocks
unban
wood
僅基岩版
clearfixedinv
mixer
resupply
set_movement_authority
setfixedinvslot
setfixedinvslots
simulationtype
volumearea
僅教育版
collect
dropall
move
position
tpagent
transfer
turn
基岩版和教育版
attack
createagent
destroy
detect
detectredstone
drop
executeasother
executeasself
getitemcount
getitemdetail
getitemspace
inspectdata
inspect
place
till
transferserver