Stats are values that affect all kinds of mechanics across Players, Mobs, Items, Skills, and more. The Stats system can be complicated but learning them is worth the trouble for the powerful things you can do with them, such as combat changes, technical utilities, and game design elements.
Stats are values that affect all kinds of mechanics across Players, Mobs, Items, Skills, and more.
While Stats system can be complicated to learn at first, its versatility will enable you to do very advanced things, such as combat changes, technical utilities, and the creation of new game design elements.
Stats are defined in the file `stats.yml`. This file can exist in the root directory of MythicMobs (`/plugins/MythicMobs/`) or in a Pack folder. (`/plugins/MythicMobs/Packs/CoolPack`)
Stats are defined in the`stats.yml` file. This file can exist in the root directory of MythicMobs (`/plugins/MythicMobs/`) or in a [Pack](MythicMobs/-/wikis/Packs) folder.
# Configuring a Mob with Stats:
It's important to be aware that players get all of their base stat values from the `stats.yml` file, while mobs get only some of their base values from the `stats.yml` file.
This example features `Some_Mob` and three configured stats: `CRITICAL_STRIKE_CHANCE` as configured in the `Stats:` section, but also its `Health` and `Damage`.
The Health and Damage stat types are natively handled in the typical format of a mob's configuration. Other stats that are configured on the mob are: `ATTACK_DAMAGE`, `ATTACK_SPEED`, and `MOVEMENT_SPEED`.
```yml
Some_Mob:
Health:50
Damage:10
Stats:
-CRITICAL_STRIKE_CHANCE 0.2
```
# Custom Stat Options
Options that can be used in the Stat in order to better customize it
|`ADDITIVE_MULTIPLIER`| Adds a multiplier the base value of a stat|
|`COMPOUND_MULTIPLIER`| Multiplies the base value of a stat, then adds it to the base value|
|`SETTER` | Overrides all modifiers and base values, and forces the stat to be what is defined|
Note that stat modifiers can be applied to/by mobs, players, items, enchants, and auras. For example, an item may add to or multiply its wielder's attack speed, while an attack may temporarily apply a COMPOUND MULTIPLIER to half a target's attack speed.
Note that stat modifiers can be applied to and by mobs, players, items, enchants, and auras. For example, an item may add to or multiply its wielder's attack speed, while an attack may temporarily apply a COMPOUND MULTIPLIER to half a target's attack speed.
<!--
TODO: define mechanics that can manipulate modifiers
-->
The `ADDITIVE` modifiers are straightforward, they add to the base stat.
The `ADDITIVE_MULTIPLIER`s all pool together (i.e. additive multipliers of 2 and 3 becoming a multiplier of 5, NOT 6) to then multiply the base stat after additives.
##
#### `ADDITIVE`
The `ADDITIVE` modifiers are straightforward: they add to the base stat.
#### `ADDITIVE_MULTIPLIER`
The `ADDITIVE_MULTIPLIER` multiply the value of the base stat by the specified value.
They all pool together (i.e. additive multipliers of 2 and 3 becoming a multiplier of 5, NOT 6) to then multiply the base stat after additives.
#### `COMPOUND_MULTIPLIER`
Finally, the `COMPOUND_MULTIPLIER` multiplies all the ADDITIVE results afterwards - this is a great place for debuffs to apply, since it would typically be calculated after additive stat additions and multipliers.
##
## Application
The two `ADDITIVE_MULTIPLIER` and `COMPOUND_MULTIPLIER` modifiers can be easy to mix up; however, this example should make it a bit more clear:
Lets say you have these modifiers:
...
...
@@ -96,10 +99,7 @@ Lets say you have these modifiers:
Regular multipliers are additive, and compound multipliers are multiplicative. You can think of it as "+10%" for Additive Multipliers vs. "x10%" for Compound Multipliers.
# Examples
## Built-In Stats
# Built-In Stats
These stats are inherently supported by MythicMobs, and can be configured in the `stats.yml` file in the plugin's root directory (`/plugins/MythicMobs/`) or inside Pack folders. (`/plugins/MythicMobs/Packs/CoolPack/`)
The player inherits the `BaseValue` of these stats, while Mobs are granted them in the `Stats:` sub-section of their config.
...
...
@@ -376,6 +376,23 @@ PARRY_COUNTERATTACK:
```
# Configuring a Mob with Stats:
It's important to be aware that players get all of their base stat values from the `stats.yml` file, while mobs get only some of their base values from the `stats.yml` file.
This example features `Some_Mob` and three configured stats: `CRITICAL_STRIKE_CHANCE` as configured in the `Stats:` section, but also its `Health` and `Damage`.
The Health and Damage stat types are natively handled in the typical format of a mob's configuration. Other stats that are configured on the mob are: `ATTACK_DAMAGE`, `ATTACK_SPEED`, and `MOVEMENT_SPEED`.
```yml
Some_Mob:
Health:50
Damage:10
Stats:
-CRITICAL_STRIKE_CHANCE 0.2
```
# Examples
## Example Custom Stats
These stats are created by the end user. Included are some examples.