Difference between revisions of "TrainCarts/MobEntering"

From BergerHealer Wiki
Jump to navigation Jump to search
(Created page with "« Go back == Putting mobs into Minecarts == Mobs are put into minecarts through a collision property rule. By...")
 
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
<languages/>
 +
<translate>
 +
<!--T:1-->
 
[[Special:MyLanguage/TrainCarts|« Go back]]
 
[[Special:MyLanguage/TrainCarts|« Go back]]
  
== Putting mobs into Minecarts ==
+
== Putting mobs into Minecarts == <!--T:2-->
Mobs are put into minecarts through a [[TrainCarts/Signs/Property|collision property]] rule. By default this automatic entering is disabled. To turn it on for a train you have just spawned or selected, run the following command:
+
 
 +
<!--T:3-->
 +
Mobs are put into minecarts through a [[Special:MyLanguage/TrainCarts/Signs/Property|collision property]] rule. By default this automatic entering is disabled. To turn it on for a train you have just spawned or [[Special:MyLanguage/TrainCarts/Commands#Selecting|selected]], run the following command:
 +
<pre>/train collision mobs enter</pre>
 +
 
 +
<!--T:4-->
 +
This command only changes this for the one train you had selected.
 +
 
 +
== Default Behavior == <!--T:5-->
 +
 
 +
<!--T:6-->
 +
If you want all minecarts placed by players to put mobs into them by default, you have two options. You can make it so that minecarts placed by players are vanilla Minecraft minecarts, but that means they cannot be trains. [[Special:MyLanguage/TrainCarts/VanillaMinecarts|See this page for more information about that.]]
 +
 
 +
<!--T:7-->
 +
Alternatively, you can change the default setting for newly placed minecarts. To do so, edit <code>plugins/Train_Carts/DefaultTrainProperties.yml</code>.
 +
 
 +
<!--T:8-->
 +
There's multiple blocks of configurations:
 +
* '''default''' is for normal players
 +
* '''admin''' for players with the <code>train.properties.admin</code> permission (OP by default)
 +
* '''spawner''' is for trains spawned with the m/s/p/etc. syntax, on spawner signs. Does not apply to saved trains that are spawned.
 +
 
 +
<!--T:9-->
 +
For the category/categories you want to edit, find the line:
 +
<pre>collision: {}</pre>
 +
Or, it might look like this if it already had some configurations:
 +
<pre>  collision:
 +
    players: DEFAULT
 +
    misc: PUSH
 +
    train: LINK
 +
    block: DEFAULT</pre>
 +
 
 +
<!--T:10-->
 +
And change it to:
 +
<pre>
 +
  collision:
 +
    animal: ENTER
 +
    monster: ENTER
 +
</pre>
 +
You can leave previous options if they existed.
 +
 
 +
<!--T:12-->
 +
On more modern versions of TrainCarts this can work too:
 +
<pre>
 +
  collision:
 +
    mobs: ENTER
 +
</pre>
 +
 
 +
<!--T:11-->
 +
Then, either restart the server, or run this command:
 +
<pre>/train globalconfig reload --defaulttrainproperties</pre>
 +
 
 +
== Other Options == <!--T:13-->
 +
 
 +
<!--T:14-->
 +
Besides ''mobs'' there is a more fine-grained list of categories of mobs that can be set specific collision options for. The names are case-sensitive, and must be lower-cased. On newer versions of TrainCarts plural names work, too.
 +
 
 +
<!--T:15-->
 +
{| class="wikitable"
 +
|-
 +
! YAML Key !! Category Description
 +
|-
 +
| pet || Tameable animals
 +
|-
 +
| jockey || Jockey mounts that can spawn for monsters, like spiders, skeletons, zombie and chickens
 +
|-
 +
| killer_bunny || Rabbit mob, that is a killer bunny specialized type
 +
|-
 +
| npc || Mobs that are NPCs, like villagers
 +
|-
 +
| animal || Passive animal mobs including mobs like the bat and squid
 +
|-
 +
| monster || Hostile monster mobs, including slimes, golems and phantom
 +
|-
 +
| passive || Passive mobs. Large overlap with animal
 +
|-
 +
| neutral || Neutral mobs that can become aggressive. For example, enderman.
 +
|-
 +
| hostile || Hostile mobs that cannot be passive. For example, creeper.
 +
|-
 +
| tameable || Same as pet. Tameable animals
 +
|-
 +
| utility || Utility mobs. Only Golems.
 +
|-
 +
| boss || Boss mobs. Ender dragon, wither.
 +
|}
 +
 
 +
</translate>

Latest revision as of 22:03, 8 January 2024

Other languages:

« Go back

Putting mobs into Minecarts

Mobs are put into minecarts through a collision property rule. By default this automatic entering is disabled. To turn it on for a train you have just spawned or selected, run the following command:

/train collision mobs enter

This command only changes this for the one train you had selected.

Default Behavior

If you want all minecarts placed by players to put mobs into them by default, you have two options. You can make it so that minecarts placed by players are vanilla Minecraft minecarts, but that means they cannot be trains. See this page for more information about that.

Alternatively, you can change the default setting for newly placed minecarts. To do so, edit plugins/Train_Carts/DefaultTrainProperties.yml.

There's multiple blocks of configurations:

  • default is for normal players
  • admin for players with the train.properties.admin permission (OP by default)
  • spawner is for trains spawned with the m/s/p/etc. syntax, on spawner signs. Does not apply to saved trains that are spawned.

For the category/categories you want to edit, find the line:

collision: {}

Or, it might look like this if it already had some configurations:

  collision:
    players: DEFAULT
    misc: PUSH
    train: LINK
    block: DEFAULT

And change it to:

  collision:
    animal: ENTER
    monster: ENTER

You can leave previous options if they existed.

On more modern versions of TrainCarts this can work too:

  collision:
    mobs: ENTER

Then, either restart the server, or run this command:

/train globalconfig reload --defaulttrainproperties

Other Options

Besides mobs there is a more fine-grained list of categories of mobs that can be set specific collision options for. The names are case-sensitive, and must be lower-cased. On newer versions of TrainCarts plural names work, too.

YAML Key Category Description
pet Tameable animals
jockey Jockey mounts that can spawn for monsters, like spiders, skeletons, zombie and chickens
killer_bunny Rabbit mob, that is a killer bunny specialized type
npc Mobs that are NPCs, like villagers
animal Passive animal mobs including mobs like the bat and squid
monster Hostile monster mobs, including slimes, golems and phantom
passive Passive mobs. Large overlap with animal
neutral Neutral mobs that can become aggressive. For example, enderman.
hostile Hostile mobs that cannot be passive. For example, creeper.
tameable Same as pet. Tameable animals
utility Utility mobs. Only Golems.
boss Boss mobs. Ender dragon, wither.