TrainCarts/命令

From BergerHealer Wiki
Revision as of 01:13, 20 September 2024 by Halogly (talk | contribs)
Jump to navigation Jump to search
Other languages:
Deutsch • ‎English • ‎中文 • ‎中文(中国大陆)‎

« 返回


介绍

通过聊天输入命令可以调控列车或单一矿车。命令还能执行常规任务,例如从世界上移除所有矿车。

基础语法

要执行命令,请使用 /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:

通常该命令会获取已知存在的所有节点,并将它们应用于自动寻路中。
使用“--lazy”参数,则当矿车驶向转辙器且从该节点开始时才会开始计算路线。

销毁所有

/train destroyall
/train removeall

销毁服务器上所有的矿车和列车。对重置插件很有用。


修复错误

/train fixbugged

销毁所有不受插件管理的矿车。这在服务器意外崩溃而关闭需要清除错误的矿车时很有用。


仅 train 命令

以下命令只能使用 /train


重命名

/train setname [名称]
/train name [名称]
/train rename [名称]

设置列车的名称。注意不能与其他已分配名称的列车有相同的名称。


设置显示名称

/train setdname [名称]
/train displayname [名称]
/train setdisplayname [名称]

设置列车的显示名称,可以重复分配。使用触发器时,该名称会显示在 SignLink 上。


train 和 cart 命令

以下命令使用 /train/cart


信息

/train info
/train i

显示 train 或 cart 的相关信息,例如名称和设置的属性。


所有权

/train claim

将自己设置为列车唯一的车主。

/train setowner [名称...]
/train setowners [名称...]
/train setowners

设置列车的车主。不填写名称则清除该列车的车主。

/train addowner [名称...]
/train addowners [名称...]

添加列车的车主。

要更改单个矿车的所有权,请使用“/cart”命令而不是“/train”。在设置列车的车主时,你可以同时在所有矿车上设置车主。如果矿车没有任何车主,则其他人可以自由编辑和销毁该矿车。


标签

/train settags [标签...]
/train settag [标签...]
/train tags [标签...]
/train tag [标签...]
/train settags

设置列车的标签。不填写标签则清除列车的标签。

/train addtags [标签...]
/train addtag [标签...]

为列车添加标签。

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.