TrainCarts/控制牌/属性
介绍
属性控制牌可以执行与指令相同的任务,但比指令更强,能够实现全自动化。控制牌需要红石激活才能运行,并且会忽略矿车的所有权,因此如果你只想定位某个你拥有的矿车,请与 switcher(转辙器)控制牌的检测矿车拥有者的功能相结合来使用。
语法
第二行: property
第三行: 要更改的属性名称
第四行: 要设置的属性的值
布尔语句
布尔属性(如玩家进入和列车减速)可以使用语句来判定 true 还是 false。这使得使用红石或基于列车的其他属性来打开或关闭某些项目变得更加容易。
远程控制
远程控制 你可以远程为列车设置属性。假设你的列车名为 train01那么你需要在控制牌上使用以下内容:
属性
可以使用 [cart] 和 [train] 设置以下属性:
属性 | 值 例子 | 解释 |
---|---|---|
addtag |
tag1 |
添加一个标签 |
settag |
taga |
设置一个标签 |
remtag | a | 移除一个标签 |
addowner |
Maxxue |
为列车添加一个车主。 |
setowner |
Maxxue |
清除所有车主并将车主设置为所填的玩家。 |
remowner | Maxxue | 从列车上移除一名车主。 |
destination | station2 | 设置目的地。 |
mobenter | false | 设置生物是否可以进入。 |
playerenter | true | 设置玩家是否可以进入。 |
playerexit | yes | 设置玩家是否可以离开。 |
playerenterexit playerexitenter |
yes | 使用相同的值,同时设置玩家是否可以进入和玩家是否可以离开。 |
spawnitemdrops spawndrops killdrops |
true | 设置矿车被破坏时是否掉落物品。 当禁用时,也会禁用箱子矿车和漏斗矿车的物品掉落。 |
只能使用 [train] 设置以下属性:
Property | Value example | Meaning |
---|---|---|
name setname rename |
Intercity#A | Sets a new name on the train. The #-sign is replaced with a number 1 to infinity. |
dname setdname displayname setdisplayname |
Trainname | Sets the display name used with trigger signs (%triggernameN%) |
exitoffset exitlocation exityaw exitpitch exitrotation |
2/0/0 200/45/-2333 30 0 90 |
Change player exit offset, yaw, pitch and rotation. Exit location uses absolute coordinates, exit offset relative to the cart(s). |
speedlimit maxspeed |
0.6 | The maximum allowed speed the train can go |
false | Set if the train pushes mobs, players, trains and misc | |
true | Set if the train pushes mobs | |
no | Set if the train pushes players | |
yes | Set if the train pushes misc (items, boats, etc.) | |
playercollision mobcollision traincollision misccollision |
default cancel kill killnodrops push enter link |
Set a collision mode for the train against players, mobs, trains or other types of entities. |
slowdown | false | Set if the train slows down, either by gravity or by friction |
slowfriction | false | Set if the train slows down due to friction |
slowgravity | false | Set if the train slows down, or speeds up, due to gravity |
gravity | 1.0 | Changes the acceleration and deceleration due to gravity (multiplier, 1.0 is default) |
linking | deny | Set if the train can link with other trains |
collision | allow | Set if the train can collide with other entities |
keepcloaded loadchunks keeploaded |
true | Set if the train keeps nearby chunks loaded |
default setdefault |
stat1def | Load one of the default train properties found in DefaultTrainProperties.yml into this train |
banking | 1 0 | Change the banking (First number: Strength, Second number: Smoothness) |
godmode
invincible |
true | Makes a train invincible, so that players cannot destroy it by hitting it.
Players with the train.break.any permission (default: OP) can break trains anyway. |
waitdistance waitdelay waitacceleration waitpredicted |
See the Wait Property section | |
route add route set route remove route clear |
destination_name | Adds/removes/clears/sets the destinations of the route set for a train. Destinations are added at the end. |
route load loadroute |
my_saved_route | Loads a previously saved route by name. |
Set name
The name property alters the name of the train. To account for multiple trains being renamed, and because every train needs a unique name, the # value is added as a counter-based replacement. For example, the first train passing over the property sign with name value: Intercity#A would be named Intercity1A and the second Intercity2A, and so on. You can use this in combination with the spawner sign to spawn trains with a fixed naming system. This naming system can then be used for remote control to control all trains of a certain spawner or category.
Wait Property
The wait properties control when a train will automatically slow down. This can be used to slow a train down when obstacles are ahead of the train. This feature largely replaces the older waiter sign, and is a lot more intelligent:
- Maintain distance with other trains up ahead
- Slow down approaching occupied mutex zones
- Slow down approaching a blocker sign that will block the train
The following 'wait' properties exist:
Property | Example Value | Description |
---|---|---|
waitdistance | 20.5 | Distance to keep between this train and the train ahead, in blocks. The train will slow down or stop completely maintaining distance. |
waitacceleration | 20kmh/s | The rate of acceleration at which trains slow down or speed up when obstacles ahead appear or disappear. When specifying two numbers, the first number is the rate speeding up, the second number the rate slowing down. This can be set without the waitdistance, and will be used to slow down when approaching blockers or mutexes. |
waitdelay | 30 | When the train is completely stopped due an obstacle, waits at least this delay in seconds until starting to move again |
waitpredicted | false | Controls whether the path the train will take is predicted. By default on. When enabled, this will take into account switcher signs and where the train will be routed to when checking for obstacles. |
They can also be configured with the /train wait <property> <value>
set of commands.