> For the complete documentation index, see [llms.txt](https://docs.mantic.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mantic.dev/manticswords/disenchanting.md). Agents can also search and read this documentation through its [MCP server](https://docs.mantic.dev/~gitbook/mcp).

# Disenchanting

Players can trade a purchased enchant level back for part of what it cost instead of being stuck with it.

Hold a ManticSwords sword and run `/sworddisenchant` to open the disenchant menu, then click the enchant to remove one purchased level. The refund is a random percentage of that level's upgrade cost, rounded to a whole number. The generated menu uses **40–65%** per enchant.

Two safeguards apply:

* Levels never drop below the tool's configured base level.
* If the refund cannot be paid, the enchant keeps its previous level.

## Configuration

The menu lives in `plugins/ManticSwords/menus/disenchant.yml`. Edit it in `/manticsword editor` → **Disenchant**, or edit the file and run `/manticsword reload`.

Each entry in `disenchant-items` is keyed by its layout slot and can set its own refund range:

```yaml
disenchant-items:
  a:
    refund-min-percent: 40.0
    refund-max-percent: 65.0
```

`refund-min-percent` defaults to `0`; `refund-max-percent` defaults to the minimum, which makes the refund deterministic. Set both to use a range.

Menu entries also accept the usual `display-name`, `lore`, `material` and custom-item keys, and expose `{level_<enchant>}`, `{max_level_<enchant>}`, `{refund_<enchant>}`, `{min_refund_percent_<enchant>}` and `{max_refund_percent_<enchant>}`, where `<enchant>` is the enchant ID.

## Main menu button

New main menus include a Disenchant button. If you use a custom `menus/main.yml`, add an item with `action: OPEN_DISENCHANT` to show one; see [main.yml](https://docs.mantic.dev/manticswords/config-files/menus/main.yml.md).

`commands.yml` can rename the command or its aliases; changing either needs a full server restart.
