# Repair

The Repair Mechanic allows players to repair damaged items in their inventory using a specific repair item. The repair process consumes the repair item while restoring a portion of the durability of the damaged item. The amount of durability restored is determined by the repair ratio defined in the mechanic configuration.

<figure><img src="https://4179595020-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCKPUSq10oq4Caxl6Izvn%2Fuploads%2Fgit-blob-66b9d47667c49f4d3adf7545db6ad49059aad2c9%2Frepair.gif?alt=media" alt="" width="640"><figcaption></figcaption></figure>

{% hint style="warning" %}
There is duplication bug using <mark style="color:red;">**Creative**</mark> mode. There is no bug using other gamemodes
{% endhint %}

{% hint style="info" %}
`ratio` <mark style="color:red;">**OR**</mark> `fixed_amount` option is required!
{% endhint %}

### One-time Repair item stackable

```yaml
# Example

repair_tool:
  material: PAPER
  itemname: <blue>Repair tool
  Mechanics:
    repair:
      ratio: 0.5         # Percentage of durability restored, relative to the item's current damage.

```

### One-time Repair item unstackable

```yaml
# Example

repair_tool:
  material: PAPER
  itemname: <blue>Repair tool
  Components:
    max_stack_size: 1
  Mechanics:
    repair:
      fixed_amount: 50         # Amount of durability restored.

```

### Reusable Repair item unstackable

```yaml
# Example

repair_tool:
  material: PAPER
  itemname: <blue>Repair tool
  Components:
    max_stack_size: 1
    durability: 50       # 50 uses
  Mechanics:
    repair:
      ratio: 0.5         # Percentage of durability restored, relative to the item's current damage.

```

### Whitelist and Blacklist

<pre class="language-yaml"><code class="lang-yaml"># Example

repair_tool:
  material: PAPER
  itemname: &#x3C;blue>Repair tool
  Components:
    max_stack_size: 1
    durability: 50       # 50 uses
  Mechanics:
    repair:
      ratio: 0.5         # Percentage of durability restored, relative to the item's current damage.
<strong>      whitelist:
</strong>      - DIAMOND_AXE
      - forest_sword
      blacklist:
      - forest_axe
      - DIAMOND_SWORD
</code></pre>
