Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

Custom servers/Bukkit/TrainCarts/Signs/Switcher

From Minecraft Wiki
Jump to: navigation, search
The contents of this page are not supported by Mojang AB, the Minecraft Wiki, or the Minecraft Forums.

Introduction[edit]

This is part of theTrainCarts Minecraft mod.

Switcher signs are the linking factor between trains and signs. It can read information from the train or cart above and toggle a lever and rails based on that. It also marks the toggleable nodes of the path finding logic.

Syntax[edit]

Second line: switcher or tag

Third line: The statement for when to switch the track left

Fourth line: The statement for when to switch the track right

Blank Sign.png
[train]
switcher

For statements it can read cart tags, destination, passengers, items and several other states. It is also possible to sort the carts when using numeric values on the last two lines. This way you can make 1 train or cart go left out of every 3 trains or carts.

The lever is toggled when either of the two statements match. The tracks are only changed if the sign is powered (or has its power inverted while not powered)'

Statements[edit]

On the third and fourth lines you can put the statements to evaluate. You can insert a direction followed up by : and then the statement to set the direction to switch to. For example:

Blank Sign.png
[!train]
switcher
l:trainsize>5
r:i@wood

Will send all trains larger than 5 carts to the left, and trains with wood in storage minecarts to the right. It parses the statements from top to bottom, so wood-bearing trains larger than 5 carts are also sent to the left.

Switcher signs currently support wildcards only when matching to tags and player names (but not, for example, to train names).

Path finding[edit]

The switcher sign is also used during path finding. If a train or cart has a destination set, and no statements on the sign match (or no statements were set), it will toggle the rails to make the train go to the requested destination. If you need to force an alternative route or need to send 'passing through' trains around, add a statement on this sign to do so.

Sorter[edit]

If you need to sort carts onto multiple tracks, you can use an internal counter:

Blank Sign.png
[!train]
switcher
3
4

Right now it will send 3 trains to the left and then 4 trains to the right direction, after which the cycle repeats itself. You can put multiple switcher signs in line to equally divide the trains onto multiple tracks. This is shown in the video below:

Redstone powered switcher[edit]

By using the redstone statements on the sign, you can completely control what direction to send the train to:

3-way redstone switcher