> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/0x48lab/skills/llms.txt
> Use this file to discover all available pages before exploring further.

# Crafting quality system

> How item quality is determined at craft time, quality tiers, lore display, the UO-style repair system, and stack size bonuses.

Every craftable item receives a quality tier when it is made. Crafting never fails — you always receive an item, but its quality depends on your skill relative to the item's difficulty.

## Quality tiers

| Quality        | Short | Skill condition                          | Judgment      | Damage / AR | Durability                                |
| -------------- | :---: | ---------------------------------------- | ------------- | :---------: | ----------------------------------------- |
| Low Quality    |   LQ  | Skill \< Difficulty                      | Deterministic |    ×0.80    | −25% (extra durability loss)              |
| Normal Quality |   NQ  | Skill ≥ Difficulty, but \< Difficulty+20 | Deterministic |    ×1.00    | No change                                 |
| High Quality   |   HQ  | Skill ≥ Difficulty+20                    | Probabilistic |    ×1.20    | +30% (33% chance to skip durability loss) |
| Exceptional    |   EX  | Skill ≥ Difficulty+30                    | Probabilistic |    ×1.50    | +50% (50% chance to skip durability loss) |

<Note>
  Quality modifiers are **relative to item difficulty**, not absolute skill values. A Crafting skill of 65 produces NQ iron gear (difficulty 25, so skill is +40 over difficulty → HQ is possible), but only LQ Netherite (difficulty 60, so skill is +5 — below threshold).
</Note>

## Quality judgment flow

The system evaluates quality in this order:

<Steps>
  <Step title="Compare skill to item difficulty">
    Calculate `skillOverDifficulty = Skill − Difficulty`.

    * If `skillOverDifficulty < 0` → **LQ** (confirmed, no roll needed)
    * If `0 ≤ skillOverDifficulty < 20` → **NQ** (confirmed, no roll needed)
    * If `skillOverDifficulty ≥ 20` → proceed to HQ/EX probability zone
  </Step>

  <Step title="HQ probability check (skill +20 to +40 over difficulty)">
    ```
    HQ Chance = (skillOverDifficulty − 20) × 5%
    ```

    At +20 over difficulty: 0% chance. At +30: 50%. At +40: 100% (HQ guaranteed).

    If the roll fails → **NQ**.
  </Step>

  <Step title="EX probability check (skill +30 or more over difficulty)">
    EX is checked before the HQ result is finalized:

    ```
    EX Chance = (skillOverDifficulty − 30) × 2%
    ```

    At +30 over difficulty: 0% EX chance. At +40: 20%. At +50: 40%.

    If the EX roll succeeds → **EX**. Otherwise the result is HQ (if HQ roll also passed).
  </Step>

  <Step title="HQ guaranteed zone (skill +40 or more over difficulty)">
    At +40 or more over difficulty, HQ is always the floor. Only the EX roll matters:

    ```
    EX Chance = (skillOverDifficulty − 30) × 2%
    ```

    If EX fails → **HQ**.
  </Step>
</Steps>

**Worked examples**

| Crafting skill | Item difficulty | Over difficulty | Result                       |
| :------------: | :-------------: | :-------------: | ---------------------------- |
|       20       |        25       |        −5       | LQ (confirmed)               |
|       40       |        25       |       +15       | NQ (confirmed)               |
|       50       |        25       |       +25       | HQ 25% chance, else NQ       |
|       65       |        25       |       +40       | HQ guaranteed; EX 20% chance |
|       90       |        60       |       +30       | HQ 50% chance; EX 0% chance  |
|       100      |        60       |       +40       | HQ guaranteed; EX 20% chance |

## Item lore display

Quality information is embedded in the item's lore:

```
Iron Sword
[High Quality]
Crafter: PlayerName    ← EX only
```

| Quality | Lore line           | Crafter line |
| ------- | ------------------- | :----------: |
| LQ      | `[Low Quality]`     |      No      |
| NQ      | *(no quality line)* |      No      |
| HQ      | `[High Quality]`    |      No      |
| EX      | `[Exceptional]`     |      Yes     |

The crafter name on EX items is the player's name. Boss-drop EX items carry one of the three legendary smiths as the crafter: **Zardoz**, **Volund**, or **Mondain**.

## Durability behavior

Durability is modified via `PlayerItemDamageEvent`:

| Quality | Behavior                                       |
| ------- | ---------------------------------------------- |
| LQ      | Extra durability loss on each hit              |
| NQ      | Standard vanilla durability loss               |
| HQ      | 33% chance to cancel each durability loss tick |
| EX      | 50% chance to cancel each durability loss tick |

## UO-style repair system

Repairing at an anvil permanently reduces the item's maximum durability. Higher Crafting skill minimizes the loss.

```
Max Durability Lost Per Repair = (110 − Crafting) / 10
```

| Crafting skill | Max durability loss |
| :------------: | :-----------------: |
|        0       |      11 points      |
|       50       |       6 points      |
|    100 (GM)    |       1 point       |

The current and maximum durability are shown in the item lore and color-coded:

| Durability % | Color  |
| :----------: | ------ |
|     > 75%    | Green  |
|    50–75%    | Yellow |
|    25–50%    | Orange |
|    \< 25%    | Red    |

### Mending enchantment

Mending success depends on Crafting skill. On a failed proc, the experience orb goes to the player but the item is not repaired.

```
Mending Success Rate = min(100%, Crafting × 100 / 60)
```

| Crafting skill | Mending success |
| :------------: | :-------------: |
|        0       |        0%       |
|       20       |       33%       |
|       30       |       50%       |
|       40       |       67%       |
|       50       |       83%       |
|       60+      |       100%      |

<Tip>
  Skill 60 is the practical threshold for reliable Mending. Below that, mending procs are unpredictable.
</Tip>

<Note>
  Elytra and Turtle Shell helmets are exempt — their Mending always succeeds regardless of Crafting skill.
</Note>

## Stack size bonus

Higher production skill levels allow stackable items to exceed the standard limit of 64.

**Skills that contribute**

* Crafting
* Cooking
* Inscription

```
Stack Limit = 64 + floor((Crafting + Cooking + Inscription) / 300 × 35)
```

| Combined skill total | Stack limit |
| :------------------: | :---------: |
|           0          |      64     |
|          100         |     \~76    |
|          150         |     \~82    |
|          200         |     \~87    |
|          300         |      99     |

**When the bonus applies**

The increased stack limit is applied automatically in three situations:

1. Picking up an item from the ground
2. Extracting an item from a container (chest, furnace, etc.)
3. Logging in (existing inventory is updated to reflect current limits)
