# Items

### Components

As of Minecraft 1.20.6, items now use what is called Components, or DataComponents, to specify specific features. This covers anything from consumable items, tool-properties and death protection.

You can see a complete list here: [Components](/configuration/items/components.md)

### ItemTemplate

This allows you to easily copy properties from a template-item onto other items.\
In the item you want to copy properties to, simply specify the ItemID\
It also supports a list of multiple items to merge several into one

```yml
template_item:
  itemname: Template Item
  material: DIAMOND

template_item1:
  template: template_item
  itemname: Template Item 1

template_item2:
  templates: 
    - template_item
    - template_item1
```

You can also use **Template Placeholder** to simplify configs even further\
\&#xNAN;**\<item\_id> -** Can be used to insert the ID of the item into the relevant part\
\&#xNAN;**\<item\_id\_capitalized> -** Insert the ID in a formatted format; `item_id` -> `Item Id`\
\&#xNAN;**\<lore> -** Insert the lore of the item at a point in the lore of the template

```yaml
item:
  template: template_item
another_item:
  template: template_item
  lore:
    - "some lore"
template_item:
  itemname: <item_id_capitalized>
  Components:
    item_model: nexo:<item_id>
  lore:
    - "template lore 1"
    - "<lore>"
    - "template lore 2"
```

### ItemModel Builder

This lets you generate an ItemModel for your NexoItem without needing to provide the ResourcePack file. You can directly reference all you need right in the config. More detailed info can be found at [https://github.com/Nexo-MC/Nexo-Documentation/blob/master/configuration/items/items/README.md#itemmodel-builder](https://github.com/Nexo-MC/Nexo-Documentation/blob/master/configuration/items/items/README.md#itemmodel-builder "mention")

### PersistentData

This lets you add custom data into the items PersistentDataContainer. These exist within the `PublicBukkitValues` of the item.\
Type is the type of data to add. Supported types can be found [here](https://jd.papermc.io/paper/26.1.2/org/bukkit/persistence/PersistentDataType.html#field-detail).\
Nexo also has some custom DataTypes which can be used, like UUID. These can be found [here](https://github.com/mfnalex/MorePersistentDataTypes#list-of-all-data-types)

```yaml
myitem:
  PersistentData:
    - type: STRING
      key: mynamespace:something
      value: "Hi this is a string"
```

There is also a CustomData [Components](/configuration/items/components.md) if setting things outside of the normal PublicBukkitValues-entry for the item is wanted

### Item Name

This allows you to change the name displayed of your item without interfering with renamed items.

```yaml
my_item:
  itemname: "<red><bold>Example"
```

### Material

This allows you to change the item type. Defaults to PAPER if unspecified.

```yaml
my_item:
  material: WOODEN_SWORD
```

### AttributeModifiers

This allows you to add minecraft attributes to your item. They are very powerful and allow you to make an item that adds hearts, increases the player's speed, etc.

{% tabs %}
{% tab title="1.21.6+" %}

```yaml
my_item:
  AttributeModifiers:
    - attribute: MOVEMENT_SPEED
      amount: 0.1 
      operation: ADD_NUMBER
      slot: MAINHAND
      display:
        type: override
        text: "Value: <red>0.1"
```

List of Attributes can be found [here](https://jd.papermc.io/paper/1.21.11/org/bukkit/attribute/Attribute.html)\
List of Operations can be found [here](https://jd.papermc.io/paper/1.21.11/org/bukkit/attribute/AttributeModifier.Operation.html)\
List of Slots can be found [here](https://jd.papermc.io/paper/1.21.11/org/bukkit/inventory/EquipmentSlotGroup.html)

The types of AttributeDisplay are; **default, hidden & override**\
Of these only **override** has an additional field, text, which is the new text to show
{% endtab %}

{% tab title="1.21.2+" %}

```yaml
my_item:
  AttributeModifiers:
    - attribute: MOVEMENT_SPEED
      amount: 0.1 
      operation: ADD_NUMBER
      slot: MAINHAND
```

List of Attributes can be found [here](https://jd.papermc.io/paper/1.21.11/org/bukkit/attribute/Attribute.html)\
List of Operations can be found [here](https://jd.papermc.io/paper/1.21.11/org/bukkit/attribute/AttributeModifier.Operation.html)\
List of Slots can be found [here](https://jd.papermc.io/paper/1.21.11/org/bukkit/inventory/EquipmentSlotGroup.html)
{% endtab %}

{% tab title="1.21.1" %}

```yaml
my_item:
  AttributeModifiers:
    # - attribute: Get the list here: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
    # - operations: 0 for ADD_NUMBER, 1 for ADD_SCALAR, 2 for MULTIPLY_SCALAR_1;
    # - slot: HAND, OFF_HAND, FEET, LEGS, CHEST or HEAD
    - attribute: MOVEMENT_SPEED
      amount: 0.1 
      operation: 0
      slot: HAND
```

{% endtab %}
{% endtabs %}

### Color

This allows you to change the color of an item made of a supported material (e.g. leather armor).

{% columns %}
{% column %}

```yaml
my_item:
  color: 3, 252, 136 #rgb
```

To change the color of your model, you need to set Tint property.\
How to set `Tint` property using BlockBench:

* Open the model in BlockBench
* Open Paint Tab
* Select face you want to change color
* Right click on the face and check `Tint` box
  {% endcolumn %}

{% column %}
![](/files/tRQXlufQgk21ATgxySx4)
{% endcolumn %}
{% endcolumns %}

### Lore

This allows you to add lines of text under the item name.

```yaml
my_item:
  lore:
  - "One line"
  - "<green>Another line"
```

### Disable Enchanting

This options allows you to prevent an item from being enchanted via anvils or enchantment tables.\
This does not prevent enchantments from being applied in the config.\\

```yaml
my_item:
  disable_enchanting: true
```

{% hint style="warning" %}
As of 1.21.2+ you should use Enchantable-Component (`Components.enchantable: 0`)
{% endhint %}

### excludeFromInventory

This option allows you to exclude an item from the nexo inventory. It will no longer be displayed but you can still get it using [nexo give command](/general-usage/commands.md#get-the-items). It is useful for items used in other plugins like inventory icons.

```yaml
my_item:  
  excludeFromInventory: true
```

### unbreakable

```yaml
my_item:
  unbreakable: true
```

### ItemFlags

{% hint style="warning" %}
As of 1.21.5+ this should be switched with `Components.tooltip_display` [https://github.com/Nexo-MC/Nexo-Documentation/blob/master/configuration/items/items/README.md#components](https://github.com/Nexo-MC/Nexo-Documentation/blob/master/configuration/items/items/README.md#components "mention")
{% endhint %}

This allows you to set ItemFlags to an item, get the list of available flags [here](https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/inventory/ItemFlag.html).

```yaml
my_item:
  ItemFlags:
    - HIDE_ENCHANTS
    - HIDE_ATTRIBUTES
    - HIDE_UNBREAKABLE
    - HIDE_DESTROYS
    - HIDE_PLACED_ON
    - HIDE_POTION_EFFECTS
```

### PotionEffects

{% hint style="warning" %}
This should be swapped with Consumable Component [Components](/configuration/items/components.md) for 1.21.4+
{% endhint %}

This allows you to add custom Potion Effects to your potion. Get the list of available effects [here](https://jd.papermc.io/paper/1.21.3/org/bukkit/potion/PotionEffectType.html).

```yaml
my_item:
  PotionEffects:
    # - type: Get the list here: https://jd.papermc.io/paper/1.21.3/org/bukkit/potion/PotionEffectType.html
    # - duration: duration of effect (2s, 3t, 4m)
    # - amplifier: potion effects level
    # - ambient: true/false, makes potion effect produce more, translucent, particles.
    # - particles: true/false, whether this effect has particles or not
    # - icon: true/false, whether this effect has an icon or not
    - type: WITHER
      duration: 10s
      amplifier: 2
      ambient: false
      particles: true
      icon: true
```

### Enchantments

If you want to enchant your item (even with non vanilla levels like for example sharpness 15), you can do it with this section. This should also support Enchantment Plugins that register enchantments as proper ones, using `namespace:key`

```yaml
my_item:
  Enchantments:
    protection: 4
    flame: 34
    sharpness: 18
```

### How do I set a specific CustomModelData?

```yaml
my_item:
  Pack:
    parent_model: "custom/items/generated_elite"
    texture: custom/items/elite_zombie_walk
    custom_model_data: 452
```

## Pack options

This part has a dedicated page, you can consult it [here](/configuration/items/item-appearance.md).

## Mechanics options

Mechanics are custom features in Nexo. You can find more under [https://github.com/Nexo-MC/Nexo-Documentation/blob/master/configuration/items/broken-reference/README.md](https://github.com/Nexo-MC/Nexo-Documentation/blob/master/configuration/items/broken-reference/README.md "mention") section


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexomc.com/configuration/items.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
