> For the complete documentation index, see [llms.txt](https://obey.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://obey.gitbook.io/wiki/tools/features/repair-system.md).

# Repair System

Documentation for the CrownTools economy repair system and Vault integration.

CrownTools features a built-in economy repair system powered by Vault, allowing players to fix broken custom tools directly in their inventory or via command.

***

## How Repairing Works

When a tool enters the **Broken** state, players can repair it if repairing is enabled in the configuration:

### Method 1: Inventory Interaction (Shift + Right-Click)

1. Open player inventory.
2. **Shift + Right-Click** the broken tool item in the inventory.
3. If the tool is repairable and the player has sufficient money, the repair cost is deducted via Vault.
4. The tool is instantly restored to full uses/durability and plays the `tool-repaired` sound effect.

### Method 2: Command (`/tools repair`)

1. Hold the broken custom tool in your main hand.
2. Run `/tools repair`.
3. Validates economy balance and restores the tool.

***

## Economy Requirements (Vault)

* CrownTools hooks directly into **Vault** to manage economy balances.
* A compatible economy plugin (e.g. EssentialsX Economy, CMI, CraftConomy) must be installed on the server for repair transactions to function.

***

## Configuration Settings

Repair mechanics are configured per tool and per usage type (`uses` / `time`) in `config.yml`:

```yaml
drill:
  uses:
    repair-price: 10000000  # Cost in currency to repair
    repairable: true        # Enable or disable repair capability
    remove-on-destruction: false
```

* **`repair-price`**: The monetary cost charged to the player upon repair.
* **`repairable`**: Set to `true` to allow repairs, or `false` to prevent players from repairing the tool.
* **`remove-on-destruction`**: Must be `false` so the tool enters a broken state rather than being deleted when depleted.
