# Inventories.yml Tutorial

## Inventories

### Pawn Promotion

This is the inventory opened when the player is about to promote a pawn. Make sure you use items with `type: piece`, to set the possible pieces to promote to.

<pre class="language-yaml"><code class="lang-yaml"><strong>inventories:
</strong>  promotion:
    slots: 27
    title: "&#x26;4Pawn Promotion"
    10:
      type: "piece: rook"
    12:
      type: "piece: bishop"
    14:
      type: "piece: knight"
    16:
      type: "piece: queen"
    0;8;18;26:
      item:
        id: BLACK_STAINED_GLASS_PANE
        name: " "
</code></pre>

### Arenas

{% hint style="warning" %}
**MineChess+** exclusive feature.
{% endhint %}

This is the inventory opened when using `/chess arenas` command. This inventory allow players to join/spectate arenas.&#x20;

```yaml
inventories:
  arenas:
    slots: 54
    title: "&4Chess Arenas &7%current_page%&8/&7%total_pages%"
    0-9;17;18;26;27;35;36;44-53:
      item:
        id: BLACK_STAINED_GLASS_PANE
        name: " "
    10-16;19-25;28-34;37-43:
      type: arena
    52:
      item:
        id: ARROW
        name: "&7Previous Page"
      type: previous_page
    53:
      item:
        id: ARROW
        name: "&7Next Page"
      type: next_page
```

The inventory has an integrated and automatic page system so you must make sure to set items with `type: arena` in the same slot path.

{% tabs %}
{% tab title="Valid Config" %}

```yaml
10-16;19-25;28-34;37-43:
  type: arena
```

{% endtab %}

{% tab title="Wrong Config" %}

```yaml
10-16:
  type: arena
19-25:
  type: arena
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
Arenas will be placed on the inventory in alphabetical order.
{% endhint %}

## Inventory Properties

### **Slots** <a href="#slots" id="slots"></a>

Defines the amount of slots this inventory will have. You can only use 9, 18, 27, 36, 45 or 54.

### **Title** <a href="#title" id="title"></a>

Defines the title of this inventory.

### **Item Slot** <a href="#item-slot" id="item-slot"></a>

Position of an item in the inventory. For a much simpler way of placing items on inventories you can use some formats:

#### **Format 1**

```yaml
<slot>:
  <item>
```

This will set an item on the slot 0.

```yaml
0:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "
```

#### **Format 2**

```yaml
<slot1>;<slot2>;<slotN>:
  <item>
```

This will set the same item on slots 0, 8 and 16.

```yaml
0;8;16:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "
```

#### **Format 3**

```yaml
<slot1>-<slotN>:
  <item>
```

This will set the same item from slots 0 to 8 (0, 1, 2, 3, 4, 5, 6, 7, 8).

```yaml
0-8:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "
```

#### **Combining formats**

This will set the same item on slots 0 to 7, 9, and 17 to 26.

```yaml
0-7;9;17-26:
  item: 
    id: BLACK_STAINED_GLASS_PANE
    name: " "
```

## Item Slots Properties <a href="#item-slots-properties" id="item-slots-properties"></a>

On these item slots you can create your own items.

### **Item** <a href="#item" id="item"></a>

This is the item itself. Use the guide from [**HERE**](https://ajneb97.gitbook.io/minechess/items-tutorial) to create them.

```yaml
0-8;9;17;18-26:
  item:
    id: "BLACK_STAINED_GLASS_PANE"
    name: " "
```

### Click Actions

Adds a list of actions to be executed when clicking on the item. List of actions [**HERE**](https://ajneb97.gitbook.io/minechess/actions).

```yaml
40:
  item:
    id: ARROW
    name: '&7Go Back'
  click_actions:
    - "player_command: menu"
```

### **Type: Piece** <a href="#type-category" id="type-category"></a>

This item type can only be placed on the `promotion` inventory.

You can place a [**custom piece item**](#custom-items) on the GUI by using the `type: piece` option. If you do so, all other item properties are ignored. \
Format: `type: "piece: <piece_name>"`

```yaml
10:
   type: "piece: rook"
```

### Type: Arena

This item type can only be placed on the `arenas` inventory.

You can place a [**custom arena item**](#custom-items) on the GUI by using the `type: arena` option. If you do so, all other item properties are ignored. \
Format: `type: "arena"`

```yaml
10-16;19-25;28-34;37-43:
   type: "arena"
```

## Custom Items

Here you define the properties of the items that will be displayed on the Pawn Promotion and Arenas inventories.

Remember to use the guide from [**HERE**](https://ajneb97.gitbook.io/minechess/items-tutorial) to create the items.

```yaml
custom_items:
  arena:
    available:
      id: GREEN_TERRACOTTA
      name: '#ffb5b5Arena: &4%arena%'
      lore:
        - '&fPlayers: &7%current_players%&8/&72'
        - '&fStatus: %status%'
        - ''
        - '&a&lCLICK to join'
    ingame:
      id: RED_TERRACOTTA
      name: '#ffb5b5Arena: &4%arena%'
      lore:
        - '&fPlayers: &7%current_players%&8/&72'
        - '&fStatus: %status%'
        - ''
        - '&a&lCLICK to spectate'
    disabled:
      id: CYAN_TERRACOTTA
      name: '#ffb5b5Arena: &4%arena%'
      lore:
        - '&7This arena is disabled'
  piece_rook:
    black:
      id: PLAYER_HEAD
      name: "&4&lRook"
      lore:
        - "&7Click to promote Pawn to Rook."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjQ1NTlkNzU0NjRiMmU0MGE1MThlNGRlOGU2Y2YzMDg1ZjBhM2NhMGIxYjcwMTI2MTRjNGNkOTZmZWQ2MDM3OCJ9fX0="
    white:
      id: PLAYER_HEAD
      name: "&4&lRook"
      lore:
        - "&7Click to promote Pawn to Rook."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjQ1NTlkNzU0NjRiMmU0MGE1MThlNGRlOGU2Y2YzMDg1ZjBhM2NhMGIxYjcwMTI2MTRjNGNkOTZmZWQ2MDM3OCJ9fX0="
  piece_bishop:
    black:
      id: PLAYER_HEAD
      name: "&4&lBishop"
      lore:
        - "&7Click to promote Pawn to Bishop."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZDdmNTc2NmQyOTI4ZGMwZGYxYjM0MDRjM2JkMDczYzk0NzZkMjZjODA1NzNiMDMzMmU3Y2NlNzNkZjE1NDgyYSJ9fX0="
    white:
      id: PLAYER_HEAD
      name: "&4&lBishop"
      lore:
        - "&7Click to promote Pawn to Bishop."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTI2Yjc3MjMyOWNmMzJmODY0M2M0OTI4NjI2YjZhMzI1MjMzZmY2MWFhOWM3NzI1ODczYTRiZDY2ZGIzZDY5MiJ9fX0="
  piece_knight:
    black:
      id: PLAYER_HEAD
      name: "&4&lKnight"
      lore:
        - "&7Click to promote Pawn to Knight."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2JiNGIyODg5OTFlZmI4Y2EwNzQzYmVjY2VmMzEyNThiMzFkMzlmMjQ5NTFlZmIxYzljMThhNDE3YmE0OGY5In19fQ=="
    white:
      id: PLAYER_HEAD
      name: "&4&lKnight"
      lore:
        - "&7Click to promote Pawn to Knight."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvN2JiNGIyODg5OTFlZmI4Y2EwNzQzYmVjY2VmMzEyNThiMzFkMzlmMjQ5NTFlZmIxYzljMThhNDE3YmE0OGY5In19fQ=="
  piece_queen:
    black:
      id: PLAYER_HEAD
      name: "&4&lQueen"
      lore:
        - "&7Click to promote Pawn to Queen."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTRiZjg5M2ZjNmRlZmFkMjE4Zjc4MzZlZmVmYmU2MzZmMWMyY2MxYmI2NTBjODJmY2NkOTlmMmMxZWU2In19fQ=="
    white:
      id: PLAYER_HEAD
      name: "&4&lQueen"
      lore:
        - "&7Click to promote Pawn to Queen."
      skull_data:
        texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTRiZjg5M2ZjNmRlZmFkMjE4Zjc4MzZlZmVmYmU2MzZmMWMyY2MxYmI2NTBjODJmY2NkOTlmMmMxZWU2In19fQ=="



```
