> For the complete documentation index, see [llms.txt](https://ajneb97.gitbook.io/playerkits-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajneb97.gitbook.io/playerkits-2/inventory.yml-tutorial.md).

# Inventory.yml Tutorial

Here you can modify all aspects of the inventories of PlayerKits 2.

## Inventories

There are different inventories on the plugin:

* **main\_inventory:** Main inventory opened using the `/kit` command.
* **preview\_inventory:** Kit preview inventory when you right click a kit item.
* **buy\_requirements\_inventory:** Inventory that will open when the kit has requirements.

{% hint style="danger" %}
You must not remove these inventories from the config or the plugin will not work!
{% endhint %}

You can also create your own inventories (like the premium\_kits\_inventory inventory on the default config), for example to create multiple pages, or even a category system.

## Inventories Properties

Each inventory has 3 properties show below:

```yaml
inventories:
  preview_inventory:
    slots: 54
    title: "&4&lKit Preview"
    45:
      item:
        id: "ARROW"
        name: "&7Go Back"
      open_inventory: previous
```

### Slots

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

### Title

Defines the title of this inventory.

{% hint style="info" %}
You can use the **`%kit%`** variable to display the kit name, only on `buy_requirements_inventory` and `preview_inventory` inventories.
{% endhint %}

### Item Slot

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

#### Format 1

This will set an item on the slot 0. Format:\
`<slot>:`\
&#x20; `<item>`

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

#### Format 2

This will set the same item on slots 0, 8 and 16. Format:\
`<slot1>;<slot2>;<slotN>:`\
&#x20; `<item>`

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

#### Format 3

This will set the same item from slots 0 to 8 (0, 1, 2, 3, 4, 5, 6, 7, 8). Format:\
`<slot1>-<slotN>:`\
&#x20; `<item>`

```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

On these item slots you can create your own items.

### Item

This is the item itself. Use the guide from [**HERE**](/playerkits-2/items-tutorial.md) to create them.

```yaml
0-9;17;18;26;27;35;36-44:
       item:
         id: "BLACK_STAINED_GLASS_PANE"
         name: " "
```

### Open Inventory

Add this option to open another inventory when the player clicks on this item.

```yaml
49:
   item:
     id: "DIAMOND_BLOCK"
     name: "&ePremium Kits"
   open_inventory: premium_kits_inventory
```

You can use `open_inventory: previous` to open the previous PlayerKits 2 inventory the player was in.

```yaml
45:
   item:
     id: "ARROW"
     name: "&7Go Back"
   open_inventory: previous
```

### Click Actions

Adds a list of actions to be executed when clicking on the item. List of actions [**HERE**](/playerkits-2/actions.md).

```yaml
36:
   item:
     id: "ARROW"
     name: "&7Go Back to an external Inventory"
   click_actions:
   - "message: &aOpening the main server menu" 
   - "console_command: chestcommands open %player% menu_server"
```

### Type: Kit

You can place a kit display item on the GUI by using the `type: kit` option. If you do so, all other properties are ignored. Format:\
`type: "kit: <kit_name>"`

```yaml
22:
   type: "kit: diamond"
```

### Type: Buy Yes, Buy No

On the `buy_requirements_inventory` inventory you can set the type of an item to buy\_yes and buy\_no:

* buy\_yes: Clicking the item will proceed to buy the kit.

```yaml
'16':
      type: buy_yes
      item:
        id: GREEN_STAINED_GLASS_PANE
        name: '&aBuy'
        amount: 1
```

* buy\_no: Clicking the item will send you back to the previous inventory.&#x20;

```yaml
'10':
      type: buy_no
      item:
        id: RED_STAINED_GLASS_PANE
        name: '&cGo Back'
        amount: 1
```
