> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/edmortars/mortars/upgrades.md).

# Upgrades

Three upgrades, bought one level at a time in the upgrades menu (shift-click buys up to `menus.shift-click-levels` at once).

| Id           | Stat                                         |
| ------------ | -------------------------------------------- |
| `chance`     | Percent chance for every mined block to fire |
| `multiplier` | Multiplier on the explosion rewards          |
| `radius`     | Explosion radius in blocks                   |

```yaml
upgrades:
  currency: beacons             # default currency of every upgrade
  chance:
    enabled: true               # false = stays at 'base' and is hidden from the menu
    display-name: '&6&lFire Chance'
    max-level: 50
    base: 0.05                  # value at level 0
    per-level: 0.01             # added per level
    decimals: 2                 # how the value is shown
    currency: beacons           # optional, overrides upgrades.currency
    cost:
      base: 100                 # price of level 1
      increase: 0               # added per level owned
      scale: 1.10               # multiplied per level owned
    actions:                    # run on every purchase. Tokens: {player} {upgrade} {level} + stat tokens
      - 'sound ENTITY_PLAYER_LEVELUP 1 1.5'
  multiplier:
    # ...
    affects: [ block-currencies, autosell, greed, rewards-per-block ]   # also: instant-currencies
  radius:
    # ...
```

* Value of a level = `base + per-level * level`.
* Price of the next level = `(cost.base + cost.increase * level) * cost.scale ^ level`, rounded up.
* The price is withdrawn and saved at once together with the new level.
* Admins: `/edmortars setlevel <player> <type> <chance|multiplier|radius> <level>` (works offline).
* Developers: `MortarUpgradeEvent` can cancel a purchase (see [API](/p/edmortars/reference/api.md)).
