/Commands
(Created page with "==== 目的地 ====") |
(Created page with "<pre>/train destination [目的地] /train dest [目的地]</pre> 设置列车的目的地。") |
||
| Line 153: | Line 153: | ||
==== 目的地 ==== | ==== 目的地 ==== | ||
<pre>/train destination [目的地] | |||
<pre>/train destination [ | /train dest [目的地]</pre> | ||
/train dest [ | 设置列车的目的地。 | ||
<div lang="en" dir="ltr" class="mw-content-ltr"> | <div lang="en" dir="ltr" class="mw-content-ltr"> | ||
Revision as of 19:05, 26 November 2025
簡介
通過命令可控制單一礦車或整條列車,也可執行一些常規操作,例如移除某個世界的全部列車。
基本語法
要執行命令,需以/train或者/cart為開頭。/train能對整條列車進行操作,而/cart則是對列車中的其中一節車廂進行操作。
選擇
針對特定列車(/train)或單一礦車(/cart)的命令,玩家需要首先選中列車或單一礦車。可通過以下方式完成:
- 進入礦車。
- 潛行並打擊礦車,這樣在創造模式下打不壞。
- 使用列車生成箱新生成一輛列車。
- 准心對準要選中的礦車,然後執行命令
/train edit。 - 使用
/train list命令來顯示的列車名稱列表,單擊列車名稱,或在/train edit <列车名称>中指定列車名稱。
目標標籤
除了以上的選中方式,使用以下的任一標籤也可直接選中列車。這些標籤同樣可在命令方塊中使用。
| 標籤 | 示例 | 描述 |
|---|---|---|
| --train <名稱> | /train maxspeed 0.0 --train train12 /train maxspeed --train @train[name=intercity*] |
通過名稱選中列車。支持@train 選擇器代替名稱,這樣你可以一次選中多輛列車。 |
| --nearest | /train maxspeed 0.0 --nearest | 選中離命令執行者最近的列車,最遠 128 格方塊距離。 |
| --near <x> <y> <z> <範圍> | /train maxspeed 0.0 --near ~ ~ ~ 5 | 選中離指定坐標最近的列車,可自定義最遠範圍。 |
| --cart <索引 或 實體uuid> | /cart destroy --nearest --cart 0 | 選擇前方的一個礦車。索引從 0 開始是前方第一個,1 是前方第二個,以此類推。單詞 'head'(頭部)和 'tail'(尾部)可用於選擇開頭和末尾的一個礦車。要選擇礦車所在的列車可以通過其他標籤來選定,否則將使用玩家當前正在編輯的列車。 |
| --world <世界名稱> | /train destroy --world world_nether --near 2 66 -134 1.5 | 默認情況下,該標籤僅針對命令執行者所在的世界。該標籤可以指定不同的世界。從伺服器控制台執行命令時需要使用該標籤。 |
全局命令
全局命令總是以/train開頭,這些命令不需要選取列車。
列表
/train list /cart list
列出所處世界中靜止和移動狀態的列車數量。該命令還會列出礦車實體(列車的所有部分)的總數和你擁有的列車。
重新調度
/train reroute [--lazy]
若自動尋路系統因路線改變而失效,可使用該命令來強制重新計算所有路線。
The '--lazy' -Parameter:
Normally the command takes all previous nodes which known existed and schedules them for routing.
With the '--lazy' parameter, this happens once a cart goes towards a switcher sign, and only from that node.
全部銷毀
/train destroyall /train removeall
銷毀伺服器上所有的礦車和列車。可用於重置插件。
漏洞修復
/train fixbugged
銷毀所有未由插件管理的礦車。若伺服器意外關閉,導致軌道上留下單獨的列車,這個功能非常有用。
僅 train 命令
以下命令只能使用 /train。
重命名
/train setname [name] /train name [name] /train rename [name]
設置列車名稱,不可與其它列車重複。
設置顯示名稱
/train setdname [name] /train displayname [name] /train setdisplayname [name]
設置列車的顯示名稱,可以重複。使用觸發器時,該名稱會顯示在SignLink上。
train 和 cart 命令
以下命令使用 /train 和 /cart。
信息
/train info /train i
顯示train或cart的相關信息,例如名稱和設置的屬性。
Ownership
/train claim
Sets you as the only owner of this train.
/train setowner [names...] /train setowners [names...] /train setowners
Sets the owner names of this train. Use no names to clear the owners.
/train addowner [names...] /train addowners [names...]
Adds the owner names to this train.
To change ownership of a single minecart, use the '/cart' command instead of '/train'. When setting train owners, you set owners on all minecarts simultaneously. If no owners are set for a minecart, it can be freely edited and destroyed by everyone else.
標籤
/train settags [标签...] /train settag [标签...] /train tags [标签...] /train tag [标签...] /train settags
為列車設置標籤。不填寫標籤則清除該列車的標籤。
/train addtags [标签...] /train addtag [标签...]
為列車添加標籤。
標籤可以與轉轍器或檢測器結合使用。例如,你可以為要銷毀的列車設置一個標籤來標記它。每個礦車都有一組單獨的標籤,在列車上設置標籤會同時為列車中的所有礦車設置標籤。
目的地
/train destination [目的地] /train dest [目的地]
設置列車的目的地。
You can also set a destination on a single minecart in the train, this way letting switcher signs split trains up in multiple carriages.
Player enter
/train playerenter [bool]
Sets if players can enter the train or minecart.
Player exit
/train playerexit [bool] /train playerleave [bool]
Sets if players can exit the train or minecart.
Pick up
/train pickup [bool]
Sets if the storage minecart(s) (in the train) pick up nearby items from the ground.
Collision
/train collision mobs enter /train collision player push /train collision train cancel /train collision block cancel
Set collision rules. This can be used to allow mobs to enter the train when they collide with it, disable trains linking or push players aside when they are in the way. Setting collision with blocks to cancel will make the train no longer check for collisions with blocks, which can help with performance.