> For the complete documentation index, see [llms.txt](https://ajneb97.gitbook.io/connecttheblocks/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/connecttheblocks/inventory.yml-tutorial.md).

# Inventory.yml Tutorial

Here you can modify aspects of the inventories of ConnectTheBlocks.

## Inventories <a href="#inventories" id="inventories"></a>

The plugin has the following inventories.

* **Main inventory:** Main inventory opened using `/ctb`. Categories will appear here. You can even create more inventories like this one.
* **Game Lower Inventory:** The lower part of the inventory when the user is playing.
* **Category/levels inventory:** Inventory that show the levels of a category. The structure of this inventory and position of items CAN'T be modified. However, you can still modify each item individually.

{% hint style="info" %}
The main\_inventory and game\_lower\_inventory inventories must not be removed from the inventory.yml file. You can create your own inventories following the same format under the inventories path. if you need to.
{% endhint %}

## Inventories Properties <a href="#inventories-properties" id="inventories-properties"></a>

Each inventory has 3 properties show below:

```yaml
inventories:
  main_inventory:
    slots: 27
    title: "&4&lCTB &8- &4Levels"
    0-8;9;17;18-26:
      item:
        id: "BLACK_STAINED_GLASS_PANE"
        name: " "
    11:
      type: "category: easy"
```

### 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**

This will set an item on the slot 0. Format:

```yaml
<slot>:
  <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:

```yaml
<slot1>;<slot2>;<slotN>:
  <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:

```yaml
<slot1>-<slotN>:
  <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 <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**](/connecttheblocks/items-tutorial.md) to create them.

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

### Open Inventory <a href="#open-inventory" id="open-inventory"></a>

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

```yaml
49:
   item:
     id: "DIAMOND_BLOCK"
     name: "&eOther Levels"
   open_inventory: other_levels
```

### Click Actions <a href="#click-commands" id="click-commands"></a>

Adds a list of actions to be executed when clicking on the item. List of actions [**HERE**](/connecttheblocks/actions.md). You can only use click actions on the main inventory.

```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: Category <a href="#type-kit" id="type-kit"></a>

You can place a [**category display item**](/connecttheblocks/levels-categories-tutorial.md#category-items) on the GUI by using the `type: category`option. If you do so, all other item properties are ignored. Format: `type: "category: <category_name>"`

```yaml
22:
   type: "category: easy"
```

## Level Inventory Types

These will be the "types" or "shapes" of levels.&#x20;

For example, the 5x5 inventory type represents an inventory where there is a central empty square surrounded by black stained glass panels.

<figure><img src="/files/ShnAQWp8uptqIu4PfXIg" alt=""><figcaption></figcaption></figure>

```yaml
level_inventory_types:
  custom_1:
    display_name: "Custom Shape"
    0;1;7-10;16-19;25-28;34-37;43-53:
      item:
        id: BLACK_STAINED_GLASS_PANE
        name: " "
```

* As you can see, the format is the same as to the inventories config, however you can only use the [**item** ](#item)property.
* You can use the optional property `display_name` to set a custom name to be displayed on inventories.
* By default there are 7 shapes: 5x5, 6x6, 7x6, 8x6, 9x6, custom\_shape\_1 and custom\_shape2.
* You can create your own inventory types/shapes. You can use this site to help you with the slots: <https://mcutils.com/inventory-slots>

## Common Items

These are common items that are used on different inventories.

### Level Selection

#### Fill

Item to decorate the level selection inventory.

<pre class="language-yaml"><code class="lang-yaml">fill:
  id: BLACK_STAINED_GLASS_PANE
<strong>  name: " "
</strong></code></pre>

#### Go Back

Item to go back to the main inventory.

```yaml
go_back:
  id: ARROW
  name: "&7Go Back to Categories"
```

#### Go Back Independent

Item to exit the level when opening a level using the `independent` parameter.

```yaml
go_back_independent:
  id: ARROW
  name: "&7Exit Level"
```

#### Next Levels

If the category has more than 40 levels, this item represents a button to go to the next page.

<pre class="language-yaml"><code class="lang-yaml">next_levels:
  id: PLAYER_HEAD
  name: "&#x26;7Next Levels"
<strong>  skull_data:
</strong><strong>    texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNTNjMWE0Y2Y0OTUxNGI1N2E3OGMxNWQ0ODRmYzBlYWE4N2YyZmM2NDg3Y2Q1NGFjM2I1ODA3ZjY0YzZhNzJkIn19fQ=="
</strong></code></pre>

#### Previous Levels

If the category has more than 40 levels, this item represents a button to go to the previous page.

```yaml
previous_levels:
  id: PLAYER_HEAD
  name: "&7Previous Levels"
  skull_data:
    texture: "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMTQyNDEzY2IyOGNkY2I3ZWRkMGRlY2E2NTRiMjZkNTg0ZDgxNjQ2ZDk0YjgyNWU4NTI5ZGIyZjJkZjMwZTAifX19"
```

### On Level

#### Go Back

Item to go back to the level selection.

```yaml
go_back:
  id: ARROW
  name: "&7Go Back"
```

#### Selected Block

Item that displays the player's current selected block. You can use `%block_id%` and `%block_display_name%` variables which are grabed from the [**game\_block configuration**](/connecttheblocks/config.yml-tutorial.md).

```yaml
selected_block:
  id: "%block_id%"
  name: "&eCurrent Selected Block"
  lore:
    - "&7Status: %block_display_name%"
```

#### Selected Block None

Item to show when the player doesn't have a selected block.

```yaml
selected_block_none:
  id: BARRIER
  name: "&eCurrent Selected Block"
  lore:
    - "&7Status: &8NONE"
    - ""
    - "&7Select a Wool Block!"
```

#### Placed Block

The block that the player places on the inventory. You can use `%block_id%` and `%block_display_name%` variables which are grabed from the [**game\_block configuration**](/connecttheblocks/config.yml-tutorial.md)

```yaml
placed_block:
  id: "%block_id%"
  name: "%block_display_name%"
```

#### Placed Block Default

The block that the level has by default. You can use `%block_id%` and `%block_display_name%` variables which are grabed from the [**game\_block configuration**](/connecttheblocks/config.yml-tutorial.md)**.**

```yaml
placed_block_default:
  id: "%block_id%"
  name: "%block_display_name%"
  lore:
    - "&7This is a fixed block. You can start"
    - "&7placing blocks of the same color"
    - "&7alongside this one."
    - ""
    - "&eLeft Click to select this color."
  enchants:
     - "FIRE_ASPECT;2"
  item_flags:
     - HIDE_ENCHANTS
```
