# Anvil Stats

## What are Anvil Stats?

1. **Permanent Buffs**: Anvil Stats provide permanent character
2. **Selection Process**: Players choose one Anvil Stat from three options
3. **Reroll Option**: Players can reroll each Anvil Stat if they don't like it
4. **Round Availability**: Anvil Stats are offered to players on specific rounds
5. **Random Selection**: A random selection is made if no choice is made by the player

<figure><img src="https://i.imgur.com/731HF4p.png" alt=""><figcaption></figcaption></figure>

## Operations

| Operation           | Description               | Formula                  |
| ------------------- | ------------------------- | ------------------------ |
| ADD\_NUMBER         | Add modifier.             | `base + modifier`        |
| ADD\_SCALAR         | Multiply the base.        | `base x (1 + modifier)`  |
| MULTIPLY\_SCALAR\_1 | Multiply the final value. | `final x (1 + modifier)` |

{% hint style="info" %}
**Base:** The base value of a player's attribute.

**Final:** The final value of a player's attribute (this includes all the previous modifiers).
{% endhint %}

## Modifiers

{% embed url="https://jd.papermc.io/paper/1.21.3/org/bukkit/attribute/AttributeModifier.html" %}

## Config Example

```yaml
FLAT_DAMAGE:
  name: "Damage"
  modifiers:
    - "GENERIC_ATTACK_DAMAGE ADD_NUMBER{0.45;0.9}"

SCALING_MOVEMENT_SPEED:
  name: "Movement Speed"
  modifiers:
    - "GENERIC_MOVEMENT_SPEED ADD_SCALAR{0.012;0.024}"

BERSERKER:
  name: "Berserker"
  modifiers:
    - "GENERIC_ATTACK_DAMAGE ADD_SCALAR{0.02;0.04}"
    - "GENERIC_MAX_HEALTH ADD_SCALAR{0.025;0.05}"
```
