Difference between revisions of "TrainCarts/Spawning"
Bergerkiller (talk | contribs) (Prepared the page for translation) |
Bergerkiller (talk | contribs) (Marked this version for translation) |
||
Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
<translate> | <translate> | ||
+ | <!--T:1--> | ||
[[Special:MyLanguage/TrainCarts/Signs|« Go back]] | [[Special:MyLanguage/TrainCarts/Signs|« Go back]] | ||
− | == Introduction == | + | == Introduction == <!--T:2--> |
+ | <!--T:3--> | ||
TrainCarts features several different ways to spawn trains. These are: | TrainCarts features several different ways to spawn trains. These are: | ||
* [[Special:MyLanguage/TrainCarts/VanillaMinecarts|'''Vanilla Minecarts''']] - Players can spawn TrainCarts Minecarts. The page details how to have Vanilla Minecart behavior as well. | * [[Special:MyLanguage/TrainCarts/VanillaMinecarts|'''Vanilla Minecarts''']] - Players can spawn TrainCarts Minecarts. The page details how to have Vanilla Minecart behavior as well. | ||
Line 12: | Line 14: | ||
− | == Spawn Pattern == | + | == Spawn Pattern == <!--T:4--> |
+ | <!--T:5--> | ||
Both the train spawn chest and the spawn sign support a spawn pattern syntax. With this syntax a train can be composed of multiple different carts or saved trains, and then spawned as a whole. | Both the train spawn chest and the spawn sign support a spawn pattern syntax. With this syntax a train can be composed of multiple different carts or saved trains, and then spawned as a whole. | ||
+ | <!--T:6--> | ||
The spawn pattern supports: | The spawn pattern supports: | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 48: | Line 52: | ||
|} | |} | ||
+ | <!--T:7--> | ||
When matching a saved train name, the longest name that matches is selected. So if you have two trains saved as ''MyTrain'' and ''MyTrainLong'', then putting ''MyTrainLong'' on a spawn sign will spawn that train. | When matching a saved train name, the longest name that matches is selected. So if you have two trains saved as ''MyTrain'' and ''MyTrainLong'', then putting ''MyTrainLong'' on a spawn sign will spawn that train. | ||
− | === Vanilla Minecarts === | + | === Vanilla Minecarts === <!--T:8--> |
+ | <!--T:9--> | ||
Default Vanilla Minecarts can be specified with the single-character names below: | Default Vanilla Minecarts can be specified with the single-character names below: | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 79: | Line 85: | ||
+ | <!--T:10--> | ||
For example, this [[Special:MyLanguage/TrainCarts/Signs/Spawner|spawn sign]] spawns a 3-minecart train: | For example, this [[Special:MyLanguage/TrainCarts/Signs/Spawner|spawn sign]] spawns a 3-minecart train: | ||
</translate> | </translate> | ||
Line 84: | Line 91: | ||
<translate> | <translate> | ||
+ | <!--T:11--> | ||
And this command gives the player a [[Special:MyLanguage/TrainCarts/Train Spawn Chest|train spawn chest]] that spawns a 3-minecart train: | And this command gives the player a [[Special:MyLanguage/TrainCarts/Train Spawn Chest|train spawn chest]] that spawns a 3-minecart train: | ||
<pre> | <pre> | ||
Line 90: | Line 98: | ||
− | === Saved Trains === | + | === Saved Trains === <!--T:12--> |
+ | <!--T:13--> | ||
Players can use <code>/train save [name]</code> to save the train they are [[Special:MyLanguage/TrainCarts/Editing|editing]] as a ''saved train''. This name can then be used in a spawn pattern. | Players can use <code>/train save [name]</code> to save the train they are [[Special:MyLanguage/TrainCarts/Editing|editing]] as a ''saved train''. This name can then be used in a spawn pattern. | ||
+ | <!--T:14--> | ||
Saved trains can also be included in a resource pack loaded on the server, like the ''TrainCarts Demo Resource Pack'' does. | Saved trains can also be included in a resource pack loaded on the server, like the ''TrainCarts Demo Resource Pack'' does. | ||
+ | <!--T:15--> | ||
Saved train names can be listed with <code>/savedtrain list</code>, and with <code>/savedtrain [name] [subcommand]</code> new saved trains can be imported or existing ones can be edited. | Saved train names can be listed with <code>/savedtrain list</code>, and with <code>/savedtrain [name] [subcommand]</code> new saved trains can be imported or existing ones can be edited. | ||
+ | <!--T:16--> | ||
'''Note:''' Saved train names are not the same as named trains (<code>/train rename</code>). There is no relation between the two. | '''Note:''' Saved train names are not the same as named trains (<code>/train rename</code>). There is no relation between the two. | ||
+ | <!--T:17--> | ||
For example, this [[Special:MyLanguage/TrainCarts/Signs/Spawner|spawn sign]] spawns a train named MyTrain: | For example, this [[Special:MyLanguage/TrainCarts/Signs/Spawner|spawn sign]] spawns a train named MyTrain: | ||
</translate> | </translate> | ||
Line 106: | Line 119: | ||
<translate> | <translate> | ||
+ | <!--T:18--> | ||
And this command gives the player a [[Special:MyLanguage/TrainCarts/Train Spawn Chest|train spawn chest]] that spawns a train named MyTrain: | And this command gives the player a [[Special:MyLanguage/TrainCarts/Train Spawn Chest|train spawn chest]] that spawns a train named MyTrain: | ||
<pre> | <pre> | ||
Line 112: | Line 126: | ||
− | === Saved Spawn Patterns === | + | === Saved Spawn Patterns === <!--T:19--> |
+ | <!--T:20--> | ||
Instead of saving a train, a (long) train spawning pattern can be saved instead with <code>/savedtrain [name] spawn [pattern]</code>. | Instead of saving a train, a (long) train spawning pattern can be saved instead with <code>/savedtrain [name] spawn [pattern]</code>. | ||
+ | <!--T:21--> | ||
For example: | For example: | ||
<pre> | <pre> | ||
Line 121: | Line 137: | ||
</pre> | </pre> | ||
+ | <!--T:22--> | ||
When spawning ''MyTrain'' this will spawn 4 random rideable Minecarts or Minecart with chest, followed by a single Minecart with Furnace. This is especially useful when patterns are too long to fit on spawn signs. These patterns can be used recursively. | When spawning ''MyTrain'' this will spawn 4 random rideable Minecarts or Minecart with chest, followed by a single Minecart with Furnace. This is especially useful when patterns are too long to fit on spawn signs. These patterns can be used recursively. | ||
− | === Repetition === | + | === Repetition === <!--T:23--> |
+ | <!--T:24--> | ||
Multiple train names or Vanilla Minecart names can be put following each other, no space required. When matching the names, it matches the longest saved train name that matches the pattern. | Multiple train names or Vanilla Minecart names can be put following each other, no space required. When matching the names, it matches the longest saved train name that matches the pattern. | ||
− | === Amount Prefix === | + | === Amount Prefix === <!--T:25--> |
+ | <!--T:26--> | ||
Digits can be put in front of names to repeat that pattern a number of times. If you want to spawn ''MyTrain'' three times, you can put <code>3MyTrain</code> | Digits can be put in front of names to repeat that pattern a number of times. If you want to spawn ''MyTrain'' three times, you can put <code>3MyTrain</code> | ||
− | === Grouped Sequences === | + | === Grouped Sequences === <!--T:27--> |
+ | <!--T:28--> | ||
Patterns can be grouped so that the amount prefix repeats the entire group, instead of only the one train or cart specified. | Patterns can be grouped so that the amount prefix repeats the entire group, instead of only the one train or cart specified. | ||
+ | <!--T:29--> | ||
For example, if you want to spawn a locomotive followed by red-green-blue carriages repeated four times (12 carriages), you can put: | For example, if you want to spawn a locomotive followed by red-green-blue carriages repeated four times (12 carriages), you can put: | ||
<pre> | <pre> | ||
Line 144: | Line 165: | ||
− | === Random === | + | === Random === <!--T:30--> |
+ | <!--T:31--> | ||
Use the % weighted prefix to randomly have a pattern choose between different types of trains to spawn. This follows a syntax [https://worldedit.enginehub.org/en/latest/usage/general/patterns/#random-pattern similar to the WorldEdit syntax]. | Use the % weighted prefix to randomly have a pattern choose between different types of trains to spawn. This follows a syntax [https://worldedit.enginehub.org/en/latest/usage/general/patterns/#random-pattern similar to the WorldEdit syntax]. | ||
+ | <!--T:32--> | ||
For example, to spawn a locomotive followed by 12 carts of random red, green or blue carriages: | For example, to spawn a locomotive followed by 12 carts of random red, green or blue carriages: | ||
<pre> | <pre> | ||
Line 153: | Line 176: | ||
</pre> | </pre> | ||
+ | <!--T:33--> | ||
These prefixes can also be applied to grouped sequences to create variable-length trains. This will spawn a locomotive with randomly 0, 1 or 2 carriages: | These prefixes can also be applied to grouped sequences to create variable-length trains. This will spawn a locomotive with randomly 0, 1 or 2 carriages: | ||
<pre> | <pre> | ||
Line 158: | Line 182: | ||
</pre> | </pre> | ||
+ | <!--T:34--> | ||
The percentage total is normalized, so in the above examples using 50% or 200% would have resulted in the same behavior. | The percentage total is normalized, so in the above examples using 50% or 200% would have resulted in the same behavior. | ||
</translate> | </translate> |
Revision as of 15:40, 21 September 2024
Introduction
TrainCarts features several different ways to spawn trains. These are:
- Vanilla Minecarts - Players can spawn TrainCarts Minecarts. The page details how to have Vanilla Minecart behavior as well.
- Spawn Sign - Spawns trains onto the track above in response to Redstone or automatically on a period
- Train Spawn Chest - A portable item with which players can pick up trains and spawn them onto the track
Spawn Pattern
Both the train spawn chest and the spawn sign support a spawn pattern syntax. With this syntax a train can be composed of multiple different carts or saved trains, and then spawned as a whole.
The spawn pattern supports:
Mechanism | Pattern | Explanation |
---|---|---|
Vanilla Minecarts | m
|
Spawns a rideable Minecart |
Saved Trains | MyTrain
|
Spawns the train saved as MyTrain |
Repetition | mmm
|
Spawns three rideable Minecarts |
Amount Prefix | 3m3s
|
Spawns three rideable Minecarts and three Minecarts with Chest as a 6-cart train |
Grouped Sequences | 3[ms]
|
Spawns 3 pairs of a rideable Minecart and Minecart with Chest. Same as msmsms
|
Random | 3[33%RedCart 33%GreenCart 33%BlueCart]
|
Spawns a 3-cart train with random color carts that were previous saved |
When matching a saved train name, the longest name that matches is selected. So if you have two trains saved as MyTrain and MyTrainLong, then putting MyTrainLong on a spawn sign will spawn that train.
Vanilla Minecarts
Default Vanilla Minecarts can be specified with the single-character names below:
Text | Minecart type |
---|---|
m | Regular Minecart |
p | Powered Minecart |
s | Storage Minecart |
t | TNT Minecart |
h | Hopper minecart |
e | Minecart with Spawner |
For example, this spawn sign spawns a 3-minecart train:
And this command gives the player a train spawn chest that spawns a 3-minecart train:
/train chest mmm
Saved Trains
Players can use /train save [name]
to save the train they are editing as a saved train. This name can then be used in a spawn pattern.
Saved trains can also be included in a resource pack loaded on the server, like the TrainCarts Demo Resource Pack does.
Saved train names can be listed with /savedtrain list
, and with /savedtrain [name] [subcommand]
new saved trains can be imported or existing ones can be edited.
Note: Saved train names are not the same as named trains (/train rename
). There is no relation between the two.
For example, this spawn sign spawns a train named MyTrain:
And this command gives the player a train spawn chest that spawns a train named MyTrain:
/train chest MyTrain
Saved Spawn Patterns
Instead of saving a train, a (long) train spawning pattern can be saved instead with /savedtrain [name] spawn [pattern]
.
For example:
/savedtrain MyTrain spawn 4[50%m 50%s] p
When spawning MyTrain this will spawn 4 random rideable Minecarts or Minecart with chest, followed by a single Minecart with Furnace. This is especially useful when patterns are too long to fit on spawn signs. These patterns can be used recursively.
Repetition
Multiple train names or Vanilla Minecart names can be put following each other, no space required. When matching the names, it matches the longest saved train name that matches the pattern.
Amount Prefix
Digits can be put in front of names to repeat that pattern a number of times. If you want to spawn MyTrain three times, you can put 3MyTrain
Grouped Sequences
Patterns can be grouped so that the amount prefix repeats the entire group, instead of only the one train or cart specified.
For example, if you want to spawn a locomotive followed by red-green-blue carriages repeated four times (12 carriages), you can put:
4[carr carg carb] loco
Random
Use the % weighted prefix to randomly have a pattern choose between different types of trains to spawn. This follows a syntax similar to the WorldEdit syntax.
For example, to spawn a locomotive followed by 12 carts of random red, green or blue carriages:
12[33%carr 33%carg 33%carb] loco
These prefixes can also be applied to grouped sequences to create variable-length trains. This will spawn a locomotive with randomly 0, 1 or 2 carriages:
[33%[] 33%carb 33%[carr carg]] loco
The percentage total is normalized, so in the above examples using 50% or 200% would have resulted in the same behavior.