# Items

This page explains how to define custom items in **YAML format**.

***

## Example

```yaml
compressed_coal:
  type: coal
  amount: 1
  name: "&8Compressed Coal"
  lore:
    - "&7A dense chunk of coal, ready for use."
  model-data: 1003
  damage: 0
  repair-cost: 10
  flags:
    - hide enchants
  unbreakable: false
  enchants:
    smite: 1
  attributes:
    - knockback_resistance 0.2 operation=multiply slot=chest name=stability
```

***

## Options

### `type`

* **Description:** The base Minecraft material.
* **Example:** `coal`, `diamond_sword`, `iron_ingot`.

### `amount`

* **Description:** Stack size of the item.
* **Default:** `1`

### `name`

* **Description:** Custom display name. Supports Minecraft color codes (`&`).
* **Example:** `&8Compressed Coal`

### `lore`

* **Description:** List of lore lines shown under the item name. Supports color codes.
* **Example:**

  ```yaml
  lore:
    - "&7A dense chunk of coal, ready for use."
  ```

### `model-data`

* **Description:** Custom model data value for use with resource packs.
* **Example:** `1003`

### `damage`

* **Description:** The item’s durability damage.
* **Default:** `0`

### `repair-cost`

* **Description:** Repair cost in an anvil.
* **Example:** `10`

### `flags`

* **Description:** A list of ItemFlags [1.16.5-1.18.2](https://helpch.at/docs/1.16.5/org/bukkit/inventory/ItemFlag.html), [1.19.4-1.21.4](https://helpch.at/docs/1.21.4/org/bukkit/inventory/ItemFlag.html), [1.21.5+](https://helpch.at/docs/1.21.5/org/bukkit/inventory/ItemFlag.html)
* **Example:**

  ```yaml
  flags:
    - hide enchants
  ```

### `unbreakable`

* **Description:** Whether the item is unbreakable.
* **Default:** `false`

### `enchants`

* **Description:** A section of enchantments and their levels. [1.16.5-1.17.1](https://helpch.at/docs/1.16.5/org/bukkit/enchantments/Enchantment.html), [1.18-1.18.2](https://helpch.at/docs/1.18/org/bukkit/enchantments/Enchantment.html), [1.19-1.20.4](https://helpch.at/docs/1.19/org/bukkit/enchantments/Enchantment.html), [1.20.5+](https://helpch.at/docs/1.20.5/org/bukkit/enchantments/Enchantment.html)
* **Example:**

  ```yaml
  enchants:
    smite: 1
  ```

### `attributes`

* **Description:** List of custom attribute modifiers.
* **Format:**

  ```
  <attribute> <value> operation=<operation> slot=<slot> name=<uniqueName>
  ```
* **Operations:**

  ```
  ADD → Adds a flat value.
  PERCENT → Increments the base value.
  MULTIPLY → Multiplies the base value.
  ```
* **Example:**

  ```yaml
  attributes:
    - knockback_resistance 0.2 operation=multiply slot=chest name=stability
  ```

***
