> 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/edminions/features/upgrades-and-food.md).

# Upgrades & Food

## Upgrades

Each minion defines its own upgrades under `upgrades:` in its file. Three mechanic types exist; ids and everything else are free.

```yaml
upgrades:
  area:
    type: area
    max-level: 10
    cost-base: 1000
    cost-increase-per-level: 500
    currency: 'tokens'      # currency id of the installed provider plugin
    chance-base: 0.5        # % chance per break at level 1
    chance-per-level: 0.5
    area-size: 2            # NxN blocks (EdDungeons: mobs cleaved)
    duration-seconds: 15
  speed:
    type: speed
    max-level: 5
    cost-base: 1000
    cost-increase-per-level: 1000
    currency: 'tokens'
    speed-per-level: 0.05             # move speed added per level
    interval-reduction-per-level: 2   # action ticks removed per level
  enchant:
    type: enchant
    max-level: 10
    cost-base: 2000
    cost-increase-per-level: 2000
    currency: 'tokens'
    chance-base: 0.2        # % chance to proc YOUR enchants on a break/hit
    chance-per-level: 0.2
```

### Upgrade mechanics

* **area** — every action rolls the chance; on success the minion farms an `area-size` × `area-size` area for `duration-seconds` (in EdDungeons it cleaves up to `area-size` mobs).
* **speed** — passively raises move speed and lowers the delay between actions.
* **enchant** — chance per action to run **the owner's** enchants through the host plugin (PinnaPrison pickaxe enchants, EdTools tool enchants, EdDungeons sword enchants).

### Costs — provider plugin currencies

`cost = cost-base + cost-increase-per-level × currentLevel`

EdMinions has **no currencies of its own** — upgrades are charged in a currency of the installed provider plugin (PinnaPrison / EdTools / EdDungeons), which is **auto-detected** since only one of them ever runs on a server. `currency` is a currency id of that plugin. If no provider is installed the upgrade simply can't be bought (a configurable message is shown).

The withdraw is asynchronous and atomic — two racing clicks can never double-charge or double-level.

## Food

Two kinds of food work in the manage menu's food slot:

**Configured food items** — defined globally in config.yml and given with `/minions givefood <player> <food> [amount]`:

```yaml
foods:
  bread:
    seconds: 1800
    item:
      material: BREAD
      name: '&#FFD54F&lMinion Bread'
      lore: [ ... ]
```

**Plain materials** — per minion type, any vanilla item can be food:

```yaml
food:
  required: true        # false = minions never need food
  max-seconds: 86400    # food cap (24h)
  items:                # material -> seconds granted per item
    BREAD: 1800
    COOKED_BEEF: 3600
    GOLDEN_CARROT: 7200
```

Food drains in real time **only while the minion is working**. When it runs out the minion **despawns entirely** (even with `display.show-when-idle` on — a hungry minion is never rendered) and its status shows the configurable `status.no-food`; it pops back the moment it is fed. Feed minions in the manage menu: pick food up in your inventory and click it onto the food slot — left click feeds the whole stack, right click a single item.
