> 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/autosell.md).

# AutoSell

Module toggle: `modules.autosell` in `config.yml`. Configuration: `autosell.yml`.

When enabled, blocks mined with the EdPrison pickaxe (inside an `edp-enchants` region) are **not dropped** — they are sold automatically into any currencies you define per material. Explosions, fills and drills can also feed autosell (`affectAutosell` options).

```yaml
permission:
  enabled: false                # require a permission to autosell
  permission: edprison.autosell
summary:
  enabled: true
  send-msg-every: 60
  message:
    - "&e&lAutosell Summary &8(1 minute)"
    - "&aMoney: &f%edprison_notation_{edprison_autosell_summary_money}%"
    - "&aTokens: &f%edprison_notation_{edprison_autosell_summary_tokens}%"
STONE:
  tokens: 5
```

Autosell is very easy to configure. You just put if the summary is enabled and a message for it. And then your materials and the currencies that will give.

## Sell prices

Every top-level key that is a **material name** maps that material to one or more `currency: amount` pairs:

```yaml
DIAMOND_ORE:
  tokens: 50
  money: 1000
```

* Amounts are parsed through PlaceholderAPI, so prices can be dynamic (e.g. `"%edprison_calc_{edprison_level_rankup}*10%"`).
* Sold amounts go through the multiplier event, so [armors](/p/features/armors.md) boost autosell income.
* Materials not listed are simply not sold (and with autosell on, their drops are removed while mining in flagged regions).

## Options

| Key                      | Type    | Description                                                            |
| ------------------------ | ------- | ---------------------------------------------------------------------- |
| `permission.enabled`     | boolean | If `true`, only players with the permission below get autosell income. |
| `permission.permission`  | string  | The permission node (default `edprison.autosell`).                     |
| `summary.enabled`        | boolean | Enables the periodic summary message.                                  |
| `summary.send-msg-every` | int     | Seconds between summaries (checked while the player mines).            |
| `summary.message`        | list    | The message lines (PlaceholderAPI parsed).                             |
| `<MATERIAL>`             | section | `currency: amount` pairs for that material.                            |

## Summary

The summary accumulates per-player, per-currency totals — autosell income plus anything an enchant adds with `<affectSummary>true</affectSummary>` in a `givecurrency` action. Totals are read with `%edprison_autosell_summary_<currency>%` and the message is sent at most every `send-msg-every` seconds while mining.

Admins can add to a player's summary manually: `/admin addsummary <player> <currency> <amount>`.
