Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
MythicMobs MythicMobs
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 140
    • Issues 140
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Create a new issue
  • Issue Boards
Collapse sidebar
  • MythicCraft
  • MythicMobsMythicMobs
  • Wiki
    • Mobs
  • Templates

Templates · Changes

Page history
added Exclude and further documented how the elements are inherited authored May 04, 2023 by Lxlp's avatar Lxlp
Hide whitespace changes
Inline Side-by-side
Showing with 57 additions and 5 deletions
+57 -5
  • Mobs/Templates.md Mobs/Templates.md +57 -5
  • No files found.
Mobs/Templates.md
View page @ ffb1ba44
......@@ -129,18 +129,68 @@ flowchart TD
But what about elements that are present on both the mob and its template?
## Shared elements
## Shared Elements
When both the Mob and its Template share some elements, one of the following three things happens:
* The element of the template is overridden by the one in the Mob
* The element of the template is overridden by the one in the Mob. (**Overriden**)
* Example: both `MonsterFaction_Base` and `ZombieBrute` have a `PROJECTILE` DamageModifier, so the one in `ZombieBrute` overrides the one in the Template, and is the one that is ultimately applied
* The element of the Template is added alongside the one of the Mob
* The element of the Template is added alongside the one of the Mob. (**Partially Overriden**)
* Example: Since the Mob has no `Faction` element, it will inherit the one in the Template, ultimately being considered as part of the `Monsters` faction
* Example: both `MonsterFaction_Base` and `ZombieBrute` have a DamageModifiers element, with the Template's having `PROJECTILE` and `ENTITY_ATTACK`, while the Mob has only `PROJECTILE`. Since no `ENTITY_ATTACK` DamageModifier is specified in the Mob, the Template's gets inherited, so in the end the `ZombieBrute` mob will take 75% of the damage it would normally take from the `ENTITY_ATTACK` damage source, despite not having that DamageModifier itself
* The elements of the Mob and of the Template are applied simultaneously, if the elements are part of a list
* The elements of the Mob and of the Template are applied simultaneously, if the elements are part of a list. (**Merged**)
* Example: `Skills` and `KillMessages` are both a list of mechanics and messagges respectively, so you can add them to both the Template and the Mob and expect to see all of them to be present on the Mob
* `AIGoalSelectors` and `AITargetSelectors` are, too, considered a list, so by adding more of them on the Mob, more Selectors are being added at the end of the list, essentially becoming other Selectors but with less importance than the ones in the Template, since Selectors that are placed lower on the list are followed only the one ones above them cannot be.
* To clear the Selectors of the Template, just use the `clear` Selector
To make this more understandable, the following is a list of all of the elements a Template may have and how the Mob will treat them if the Mob has them too
| **Element** *(in the Template)* | **How it is inherited** *(if the Mob has it too)* |
|---------------------------------------|----------------------------------------------------------------|
| Type | Overriden |
| Display | Overriden |
| Health | Overriden |
| Damage | Overriden |
| Armor | Overriden |
| Bossbar | Overriden |
| Faction | Overriden |
| Mount | Overriden |
| Options | Partially Overriden (only the shared options are overriden) |
| Modules | Partially Overriden (only the shared modules are overriden) |
| AIGoalSelectors | Merged* |
| AITargetSelectors | Merged* |
| Drops | Merged |
| DamageModifiers | Partially Overriden (only the shared modifiers are overriden) |
| Equipment | Partially Overriden (only equipment with the same slot is overriden)|
| KillMessages | Merged |
| LevelModifiers | Partially Overriden (only the shared modifiers are overriden) |
| Disguise | Overriden |
| Skills | Merged |
| Trades | Partially Overriden (only trades with the same number are overriden)|
\* A special note must be made regarding the behavior of the AIGoalsSelector and the AITargetSelectors elements, as only stating that they are "merged" is a bit reductive. The selector of the Mob are, in fact, added to the end of the Template's. So, for instance, if the Template has a `clear`,`meleeattack` AIGoals and the Mob has a `randomstroll` one, the final mob will effectively have `clear`,`meleeattack`,`randomstroll` as its AIGoals.
If one wishes to reset the Selectors from the Template, one can either use the [`Exclude`](#excluding-elements) element or use the `clear` Selector, as that will "delete" every Selector that came before it.
## Excluding Elements
It is possible to stop a Mob from inheriting unwanted elements from its Template using the following syntax
```yaml
Exclude:
- Element1
- Element2
- {...}
```
So, for instance, if we wanted a mob to not inherit the Equipment, the AITargetSelectors and the Skills, we would be using
```yaml
ExampleMob:
Template: MobTemplate
Exclude:
- Equipment
- AITargetSelectors
- Skills
```
And the mob will now not inherit the specified elements.
## Chained Templates
But why should we stop at only one Template? After all, Templates can have a Template, too! Let's revisit out example from earlier, but this time splitting it up a little bit more
......@@ -257,4 +307,6 @@ Then our dear `ZombieBrute` now will spawn with a shiny new set of diamond armor
flowchart TD
A[MonsterFaction_Base] -->|Is Inherited by| B[MonsterFaction_MeleeEntity] --->|Is Inherited by| C[ZombieBrute]
D[DiamondArmorSet] --> |Is Inherited by| C[ZombieBrute]
```
\ No newline at end of file
```
##
\ No newline at end of file
Clone repository
Home
Changelogs
Premium Features
Commands and Permissions
FAQ / Common Issues
Mythic Add-ons
Compatible Plugins
API Information
Packs
Mobs
  • Mob Options
  • Mob Levels
  • Mob Factions
  • Power Scaling
  • Damage Modifiers
  • Equipment
  • BossBar
  • Custom AI
  • Custom Kill Messages
  • Threat Tables
  • Immunity Tables
  • Templates
  • Extra: Disguises
  • Extra: ModelEngine
Skills
  • Mechanics
  • Effects
  • Targeters
    • Filters
  • Triggers
  • Conditions
    • In-line conditions
  • Placeholders
  • Variables
  • Math
Items
  • Options
  • Attributes
  • Enchantments
  • Potions
  • Banner Layers
  • Firework
Drops & DropTables
  • Drop Types
Spawning
  • Spawners
  • Random Spawns
Examples