Mods/TrainCarts/Signs/Statements

Introduction
The switcher and detector signs use statements to perform a certain task. In the case of the switcher sign, toggling the lever and tracks. The third and fourth lines are used to put these statements, which are parsed by the plugin automatically.There are multiple syntax rules, which will be expanded whenever something new needs to be evaluated.

The third and fourth lines act as a logical or when toggling the lever. When either of the two statements are correct, it will toggle the lever. You can use the output of this lever to power another sign, possibly making complete logic routines using minecarts.

Use cases
Generally you won't need to use statements. The internal path finding can do most of the required path finding, and anything else can be done using redstone. But, if you have to categorize carts based on certain properties, using these statements is inevitable. A few examples where this can be used.

Remove empty minecarts
If the minecart contains no passenger, a destructor sign is powered.

Send the train once it contains items
Once the train contains an item, power a station sign.

Send a train to a certain player
If the cart is owned by a set player, the track is toggled to lead to that player.

Syntax
You can put a !-sign in front of the statement to act as a NOT. You can read 'the train' as 'the cart' if [cart] is used on the first line.

And logic
Since everything is evaluated as an OR, how can you check if the train has two of the same? The easiest method is to invert two statements, toggling a lever which powers an inverted sign. For example:

If this proves too hard to do (you need to evaluate more than 3 statements), you will have to use a redstone circuit and multiple switcher signs instead.

Tags
For all statements other than in the syntax table above, the name is compared to tags on the train. To find the tags, you can use wildcards to check for multiple tags at once: * - has a tag !* - has no tags *a - has a tag ending with 'a' a* - has a tag starting with 'a'  *a* - has a tag containing 'a'  *ab*cd* - has a tag containing both 'ab' and 'cd'

For example, the following sign uses tags to switch tracks. If the train contains a tag starting with station it goes left, if it contains a tag containing main it will go right. If it contains both, it will go straight ahead.