> 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/features/currencies-system.md).

# Currencies System

Ability to create infinite currencies

Currencies are defined under `currencies:` in `config.yml`. Each currency gets its own **auto-registered command** at startup, with configurable name, aliases, permissions and subcommands. The defaults shipped are: `blocks`, `rankupblocks`, `pickaxeblocks`, `tokens` and `money`.

## Example

```yaml
blocks:
  block-currency: true
  limit: 0
  commands:
    main:
      cmd: blocks
      permission: edprison.blocks
      aliases:
        - "blocks"
    give:
      enabled: true
      permission: edprison.blocks.give
      cmd: give
    set:
      enabled: true
      permission: edprison.blocks.set
      cmd: set
    remove:
      enabled: true
      permission: edprison.blocks.remove
      cmd: remove
    bal:
      enabled: true
      permission: edprison.blocks.bal
      cmd: bal
```

For example, we create a block currency. We put block-currency: true because we want that every block mined, it will add x1 currency. Then we put a limit (0 for infinite) and the main commands.

## Currency options

| Key                         | Type    | Description                                                                                                                                                       |
| --------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `block-currency`            | boolean | If `true`, the currency increases automatically for **every block mined** (multiplied by armor multipliers). Defaults: `blocks`, `rankupblocks`, `pickaxeblocks`. |
| `is-vault`                  | boolean | If `true`, this currency is registered with **Vault** as the server economy (default: `money`). Only one currency should have this.                               |
| `limit`                     | number  | Maximum balance. `0` means unlimited (internally 10^36).                                                                                                          |
| `commands.main.cmd`         | string  | The registered command name.                                                                                                                                      |
| `commands.main.permission`  | string  | Permission for the main command.                                                                                                                                  |
| `commands.main.aliases`     | list    | Command aliases.                                                                                                                                                  |
| `commands.<sub>.enabled`    | boolean | Whether the `give`/`set`/`remove`/`bal` subcommand exists.                                                                                                        |
| `commands.<sub>.cmd`        | string  | The literal used for the subcommand (e.g. `give`).                                                                                                                |
| `commands.<sub>.permission` | string  | Permission for the subcommand.                                                                                                                                    |

## Generated command behaviour

Using `/tokens` as an example (all currency commands behave identically):

| Command                            | What it does                                       |
| ---------------------------------- | -------------------------------------------------- |
| `/tokens`                          | Shows your own balance. Player-only.               |
| `/tokens give <player> <amount>`   | Adds currency (works for cached offline players).  |
| `/tokens set <player> <amount>`    | Sets the balance.                                  |
| `/tokens remove <player> <amount>` | Removes currency.                                  |
| `/tokens bal [player]`             | Shows a player's balance (or your own if omitted). |

Amounts must be positive numbers (`give`/`remove` reject `<= 0`, `set` rejects `< 0`).

{% hint style="info" %}
Currency commands are registered directly into Bukkit's command map at startup — adding a new currency requires a **server restart**, not just `/edprison reload`.
{% endhint %}

## Block currencies

Every block mined (with the EdPrison pickaxe, inside an `edp-enchants` region) fires an internal `EdPrisonAddMultiplierCurrency` event for each `block-currency: true` currency. [Armors](/p/features/armors.md) hook this event to add multipliers; the final amount added is `blocks * (1 + multipliers)`.

## Levels are currencies too

Level types (`rankup`, `pickaxe`) are stored like currencies and can be read with the same economy placeholders (`%edprison_economy_<id>%`). See [Leveling System](/p/features/leveling-system.md).

## Admin utilities

* `/admin reseteconomy <currency>` — resets that currency for **all** players.
* `[GIVEECO] <currency> <amount>` — action prefix usable anywhere commands are configured (rewards, GUI clicks, pouches, ...).
