/Commands
概要
コマンドを使うことで、列車やトロッコをチャットから操作することができます。コマンドでは、ワールドから列車をすべて消し去るなどのような、あらかじめ設定されているいろいろな操作を行うことができます。
基本の記法
TrainCartsでは、/trainか/cartのどちらかを使います。/trainのほうはひとつの列車全体を、/cartのほうは列車を構成する内の単一のトロッコを対象とします。
対象の選択
列車を対象とする/trainやトロッコを対象とする/cartを使うには、まず対象とするものを選択しなくてはなりません。選択するには、次のうちどれかを行ってください。
- トロッコへ乗り込む。
- スニークしてトロッコを殴る。クリエイティブ限定の方法です。
- トレインチェストを使って新しい列車をスポーンさせると、自動で選択が行われます。
- トロッコへ視線を向けて、コマンド
/train editを実行する。 /train listでトロッコの一覧を表示し、選びたい列車の名前をクリックする。それか、/train edit (列車名)で選択できます。
ターゲットフラグ
上記のようにトロッコを選択せずとも、コマンドで直接対象を選択することができます。コマンドブロックで列車にあれこれするときもこれで行えます。
| フラグ | 例 | 説明 |
|---|---|---|
| --train <name> | /train maxspeed 0.0 --train train12 /train maxspeed --train @train[name=intercity*] |
名前で列車を選択します。また、名前の代わりに@trainセレクターを利用すると、一気に複数の列車を対象にできます。 |
| --nearest | /train maxspeed 0.0 --nearest | 実行者から一番近い列車です。なお、範囲は最大でも128ブロック圏内です。 |
| --near <x> <y> <z> <distance> | /train maxspeed 0.0 --near ~ ~ ~ 5 | 指定した座標に最も近い列車を指定します。 |
| --cart <index or entity_uuid> | /cart destroy --nearest --cart 0 | 列車を構成するうちの、一番前からトロッコを数えていきます。インデックス0が一番前、インデックス1はその後ろです。headあるいはtailと入力すれば、一番前か一番後ろを選べます。トロッコを選択する列車は現在選択中のものが使われますが、ほかのフラグを組み合わせることもできます。 |
| --world <worldname> | /train destroy --world world_nether --near 2 66 -134 1.5 | 通常、コマンドは実行者のいるディメンション、ワールドだけを対象とします。これを使うと、別のディメンションからでも列車を指定できます。サーバーのターミナルからコマンドを使う時はこれが必要です。 |
グローバルコマンド
The below commands only work on /train and don't require a selection to function.
List
/train list /cart list
Lists the number of stationary and moving trains in the world. It also lists the total number of cart entities (as part of those trains) and lists the trains that belong to you.
Reroute
/train reroute [--lazy]
If the path finding system is failing because the track got changed, you can use this command to force the plugin to re-calculate all destination paths.
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.
Destroy all
/train destroyall /train removeall
Destroys all minecarts and trains on the server. Can be useful to re-set the plugin.
Fix bugged
/train fixbugged
Destroys all minecarts that are not managed by the plugin. Useful for is the server was shut down unexpectedly, leaving orphaned trains on the track.
Train - only commands
The below commands work only for /train.
Rename
/train setname [name] /train name [name] /train rename [name]
Sets the name of the train, the name may not be assigned to another train already
Set display name
/train setdname [name] /train displayname [name] /train setdisplayname [name]
Sets the display name of the train, may be double-assigned. This name is displayed on SignLink-variable signs when using trigger signs.
Train and Cart commands
The below commands work for both /train and /cart.
Information
/train info /train i
Shows train or cart related information, such as the name and set properties.
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.
Tags
/train settags [tags...] /train settag [tags...] /train tags [tags...] /train tag [tags...] /train settags
Sets the tags of this train. Use no tags to clear the tags.
/train addtags [tags...] /train addtag [tags...]
Add tags to this train.
Tags can be used in combination with switcher or detector signs. For example, you can set a tag to order a train to be destroyed. Every minecart has a separate set of tags, setting tags on a train sets it for all minecarts simultaneously.
Destination
/train destination [destination] /train dest [destination]
Sets the destination for this train.
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.