> For the complete documentation index, see [llms.txt](https://zauctionhouse.groupez.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zauctionhouse.groupez.dev/old-configurations/items.md).

# Items

### Example:

Here is an example of an item in a yml file:

```yaml
item:
  material: 3
  data: 0
  durability: 0
  amount: 1
  glow: true
  lore:
    - "line"
    - "&cred line"
    - "&fwhite line"
  name: "&eMy awesome name"
  enchants:
    - PROTECTION_ENVIRONMENTAL,4
  flags:
    - HIDE_ENCHANTS
```

### Example [potion](https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionType.html):

```yaml
test2:
  item:
    material: POTION
    potion: "SPEED"
    splash: true
    extended: true
    level: 1
  type: NONE
  slot: 33
```

### Example player head:

```yaml
test3:
  item:
    material: PLAYER_HEAD
    url: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZTM2ZTk0ZjZjMzRhMzU0NjVmY2U0YTkwZjJlMjU5NzYzODllYjk3MDlhMTIyNzM1NzRmZjcwZmQ0ZGFhNjg1MiJ9fX0="
  type: NONE
  slot: 34
```

### Add player HEAD

You have to add `HEAD` in the item name to be able to display the head of the player who opened the GUI.

Example:

```yaml
item:
    material: PLAYER_HEAD
    name: "HEAD&a%player_name%"
```

If you are below version 1.13 you have to do

```yaml
item:
  material: SKULL_ITEM
  data: 3
  name: "HEAD&a%player_name%"
```

### Head Database

```yaml
item:
  material: hdb:<head id>
type: NONE
slot: 0
```

### EpicHead

```yaml
item:
  material: eh:<head id>
type: NONE
slot: 0
```

## Now let's move on to the explanation of each element

* `material`

You can put the item ID for versions lower than 1.13 and you can put the material name for higher versions. List of materials: <https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html>

* `data`

The item data works only for versions lower than 1.13, the default value is 0.

* `amount`

The number of items (from 1 to 64), the default value is 1.

* `durability`

Allows you to change the durability of items, works only for armor and other items that use durability, the default value is 0.

* `name`

Allows you to change the name of the item, by default the name is null.

* `glow`

Allows to add an enchantment to the item and to add the HIDE\_ENCHANTS flag

* `lore`

Allows to change a lore of the item, by default the lore is null.

* `enchants`

Allows you to add enchantments, you have to put the name of the enchantment then the level of the enchantment, like this: `ENCHANT,ENCHANT_LEVEL` List of enchantments available: <https://hub.spigotmc.org/javadocs/spigot/org/bukkit/enchantments/Enchantment.html>

* `flags`

This option is available for servers greater than or equal to the 1.8. List of flags: <https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFlag.html>

* `modelID`

Allows you to put a custom model data on an item

## Developer - Loading and saving an itemtack

To save and load an item you will have to use the [ItemStackLoader](https://github.com/Maxlego08/TemplatePlugin/blob/master/src/fr/maxlego08/template/zcore/utils/loader/ItemStackLoader.java) class

```java
//Create class
ItemStackLoader loader = new ItemStackLoader();

//Load your confirguration
YamlConfiguration configuration = plugin.getConfig();

//You have to put a . at the end of your path to load the item.
String path = "item.";

//Load ItemStack
ItemStack itemStack = loader.load(configuration, path);

//Save ItemStack
loader.save(itemStack, configuration, path);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://zauctionhouse.groupez.dev/old-configurations/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.
