# Levels/Categories Tutorial

In this page you will find all properties of levels/categories configuration files. Everytime you modify something in these files you must reload the plugin using `/minewords reload`.

## On Game Title <a href="#on-game-title" id="on-game-title"></a>

The title of the opened inventory when playing on a level of this category.

```yaml
on_game_title: "#ff8417&lLevel %level%"
```

## Inventory Items <a href="#inventory-items" id="inventory-items"></a>

The format of each item is the following:

```yaml
inventory_items:
  <type>:
    <item>
```

{% hint style="info" %}
Remember that the `item` to be displayed has the properties listed [**HERE**](https://ajneb97.gitbook.io/minewords/items).
{% endhint %}

{% hint style="success" %}
You can use PlaceholderAPI variables on the name and lore of all these items.
{% endhint %}

### Category Items <a href="#category-items" id="category-items"></a>

Each category will be represented by its own item in the main inventory. This item will vary depending on the current state of the category. For now there are two possible states.

#### **1. Category**

The item displayed by default. You can tell the players on this item the amount of levels the category has, the difficulty of them, and maybe the possible rewards.

```yaml
inventory_items:
    category:
      id: ORANGE_TERRACOTTA
      name: "&8[#ff8417&lNormal&8] #ff8417&lLevels"
      lore:
        - "&7Words to find with increased difficulty"
        - "&81 Level"
        - ""
        - "&7Rewards:"
        - "&8🡪 #ff8417$750 &7on each level."
        - "&8🡪 #ff841770XP &7on each level."
        - ""
        - "&6Status: &8[%progress%&8] %percentage%%"
```

{% hint style="info" %}
**Variables:**

* `%progress%` (A progress bar showing the progress of the levels completed from this category)
* `%percentage%` (Percertage of the levels completed from this category)
  {% endhint %}

#### **2. Category No Requirements**

The item displayed when the player doesn't have the necessary requirements to play on this category. You should tell the players on this item, what requirements are needed.

```yaml
inventory_items:    
  category_no_requirements:
      id: RED_TERRACOTTA
      name: "&8[#de0000&lHard&8] #de0000&lLevels"
      lore:
        - "&7Wordst of the wordst"
        - "&81 Level"
        - ""
        - "&cYou must complete the NORMAL"
        - "&clevels first."
```

### Level Items <a href="#level-items" id="level-items"></a>

Each level of this category will be represented on the [**category inventories**](https://ajneb97.gitbook.io/minewords/inventory.yml-tutorial) by its own item. This item will vary depending on the current state of the level. These are the possible states.

#### **1. Level Unlocked**

The item displayed when the level is ready to be played.

```yaml
inventory_items:     
  level_unlocked:
      id: YELLOW_STAINED_GLASS_PANE
      name: "#de0000&lLevel %level% &7(%progress%)"
      lore:
        - "#ddddddStatus: &eUNLOCKED"
        - "#ddddddDifficulty: #de0000HARD"
```

{% hint style="info" %}
**Variables:**

* `%level%` (Number of this level)
* `%progress%` (Current progress of this level depending on found words)
  {% endhint %}

#### **2. Level Blocked**

The item displayed when the level is blocked, which means the previous level has not been completed.

```yaml
inventory_items:  
  level_blocked:
      id: RED_STAINED_GLASS_PANE
      name: "#de0000&lLevel %level%"
      lore:
        - "#ddddddStatus: &cBLOCKED"
        - "#ddddddDifficulty: #de0000HARD"
```

{% hint style="info" %}
**Variables:**

* `%level%`(Number of this level)
* `%progress%` (Current progress of this level depending on found words)
  {% endhint %}

#### **3. Level Completed**

The item displayed when the level has been completed.

```yaml
inventory_items:  
  level_completed:
      id: GREEN_STAINED_GLASS_PANE
      name: "#de0000&lLevel %level%"
      lore:
        - "#ddddddStatus: &aCOMPLETED"
        - "#ddddddDifficulty: #de0000HARD"
        - ""
        - "#ddddddHidden word was:"
        - "#de0000%hidden_word%"
```

{% hint style="info" %}
**Variables:**

* `%level%` (Number of this level)
* `%hidden_word%` (Hidden word of the level)
  {% endhint %}

## Modify Levels Amount <a href="#modify-levels-amount" id="modify-levels-amount"></a>

Whether the amount value of the [**Level Items**](#level-items) should be changed depending on the number of the level. Be careful if your category has more than 64 levels!

```yaml
modify_levels_amount: true
```

## Rewards <a href="#rewards" id="rewards"></a>

Rewards are given through actions. All Actions can be found [**HERE**](https://ajneb97.gitbook.io/minewords/actions).

### Per Level <a href="#per-level" id="per-level"></a>

Default actions to be executed when the player finishes a level from this category.

```yaml
rewards:
    per_level:
      - "centered_message: #de0000&m                  #de0000[ LEVEL %level% COMPLETED ]#de0000&m                  "
      - "centered_message: "
      - "centered_message: &fRewards:"
      - "centered_message: &7- &a$950"
      - "centered_message: &7- &a90XP"
      - "centered_message: "
      - "centered_message: #de0000&m                  #de0000[ LEVEL %level% COMPLETED ]#de0000&m                  "
      - "console_command: eco give %player% 950"
      - "console_command: xp give %player% 90"
```

{% hint style="info" %}
**Variables:**

* `%level%` (Number of the current level)
* `%player%` (The name of the player)
  {% endhint %}

### All Levels <a href="#all-levels" id="all-levels"></a>

Default actions when the player finishes all levels from this category.

```yaml
rewards: 
  all_levels:
      - "centered_message: #0eff9c&m                  #0eff9c[ EASY CATEGORY COMPLETED ]#0eff9c&m                  "
      - "centered_message: "
      - "centered_message: &fRewards:"
      - "centered_message: &7- &a$2500"
      - "centered_message: &7- &a250XP"
      - "centered_message: "
      - "centered_message: #0eff9c&m                  #0eff9c[ EASY CATEGORY COMPLETED ]#0eff9c&m                  "
      - "console_command: eco give %player% 2500"
      - "console_command: xp give %player% 250"
```

{% hint style="info" %}
**Variables:**

* `%player%` (The name of the player)
  {% endhint %}

## Requirements <a href="#requirements" id="requirements"></a>

Requirements needed to unlock this category. You can add multiple requirements/conditions. More info [**HERE**](https://ajneb97.gitbook.io/minewords/requirements).

```yaml
requirements:
    - "%minewords_category_completed_normal% == true"
```

## No Requirements Error Message <a href="#no-requirements-error-message" id="no-requirements-error-message"></a>

Message to be sent to the player when requirements are not satisfied.

```yaml
no_requirements_error_message: "&cYou must complete the NORMAL levels first."
```

## Levels

All Levels follow the same structure. Make sure levels are in order, writing the number correctly, starting from level 1.

```yaml
levels:
  <number>:
    level:
    words:
```

### Level Structure

The level structure contain the words to find of the level. Each line corresponds to a word.

* Each element of the list **must** have 8 characters.
* Words don't necessarily need to have 8 letters. If you want a shorter word, use a "-". This character will be replaced by the [**no\_letter custom item**](https://ajneb97.gitbook.io/minewords/config.yml-tutorial#no-letter) in the inventory.
* You can add as many words as you want.

```yaml
level:
- "-CALORIE"
- "-PRIMER-"
- "--AGATE-"
- "--CHRIS-"
- "-ROTOR--"
- "MONSTER-"
- "PROPANE-"
- "-OCEAN--"
- "--SEVEN-"
- "---DVD--"
```

{% hint style="warning" %}
If you make a change on the number of words, the level will be reset for players that have a certain % of progress.
{% endhint %}

### Words Structure

For each element of the level structure (starting from element 1), you need to set a hint or a description of the word to find.

```yaml
words:
      1:
      - "&7Unit of energy often tracked in diets."
      2:
      - "&7Complex time-travel film known for its dense plot."
      3:
      - "&7Type of gemstone with unique banding patterns."
      4:
      - "&7Name of the actor who plays Thor."
      5:
      - "&7Rotating part of a machine, like in an engine"
      - "&7or helicopter."
      6:
      - "&7Fearsome and ugly creature."
      7:
      - "&7Gas commonly used for heating and cooking."
      8:
      - "&7What we know is a drop, what we don't"
      - "&7know is an ____."
      - "&7&o~Isaac Newton"
      9:
      - "&7Number of deadly sins."
      10:
      - "&7Disc used for storing movies or data."
      hidden:
        column: 4
```

For example in this case, the word 1 corresponds to the first element of the previous list, which is "CALORIE". The word 2 corresponds to "PRIMER", and so on.

### Hidden Column

This will allow you to set a hidden word on a certain column of the inventory (a vertical word instead of a horizontal one). You can completely remove this option if you don't want it.

If you want to use this option, the idea is to put the words on a certain order so the hidden word is in fact a real word and not just gibberish.

The possible values are: 1 to 8.

```yaml
hidden:
    column: 2
```

<figure><img src="https://3146035997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz5WdiYXvHBkYYTY9gyD2%2Fuploads%2FFki2Aox8nhdGvry7rx60%2F2024-10-05_18.12.28.png?alt=media&#x26;token=4b54f03d-7aa9-4333-9fa1-56de9b9a51ca" alt=""><figcaption><p>As you can see, the hidden word is in the second column.</p></figcaption></figure>

Sometimes you want to set a phrase instead of a single word, having multiple columns in yellow. To manage that follow this format:

```yaml
hidden:
    column: <column_1>:<first_element>-<last_element>;<column_2>:<first_element>-<last_element>
```

For example. If you want to create a hidden word like "MY PLUGIN", in columns 4 and 5:

```yaml
hidden:
    column: "4:1-2;5:3-8"
```

<figure><img src="https://3146035997-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fz5WdiYXvHBkYYTY9gyD2%2Fuploads%2FbGjJjBmtqoPEp01h8aUm%2F2024-10-05_18.14.39.png?alt=media&#x26;token=c0624d15-8824-4eae-8e6f-99fb7a8ba122" alt=""><figcaption><p>Hidden word on fourth and fifth column.</p></figcaption></figure>

### Custom Inventory Items

You can replace the [**Level Items**](#level-items) with custom ones used only for this level.

#### Level Unlocked

The item displayed when the level is ready to be played. All variables from [**HERE**](#id-1.-level-unlocked) apply.

```yaml
inventory_items:
  level_unlocked:
    id: YELLOW_STAINED_GLASS_PANE
    name: "#0eff9c&lLevel %level% &7(%progress%)"
    lore:
      - "#ddddddStatus: &eUNLOCKED"
      - "#ddddddDifficulty: #0eff9cEASY"
      - ""
      - "&7This item will replace the default item"
      - "&7only for this level."
```

#### Level Blocked

The item displayed when the level is blocked, which means the previous level has not been completed. All variables from [**HERE**](#id-2.-level-blocked) apply.

```yaml
inventory_items:
  level_blocked:
    id: RED_STAINED_GLASS_PANE
    name: "#0eff9c&lLevel %level%"
    lore:
      - "#ddddddStatus: &cBLOCKED"
      - "#ddddddDifficulty: #0eff9cEASY"
      - ""
      - "&7&oRage, rage, agains the dying of the light."
```

#### Level Completed

The item displayed when the level has been completed. All variables from [**HERE**](#id-3.-level-completed) apply.

```yaml
inventory_items:
  level_blocked:
    id: GREEN_STAINED_GLASS_PANE
    name: "#0eff9c&lLevel %level%"
    lore:
      - "#ddddddStatus: &aCOMPLETED"
      - "#ddddddDifficulty: #0eff9cEASY"
      - ""
      - "#ddddddHidden word was:"
      - "#0eff9c%hidden_word%"
      - ""
      - "&7This is a custom item for this level only."
```

### Custom Rewards

Allows you to set custom rewards for this level only. Will replace the default [**per level rewards**](#per-level) from this category.

```yaml
rewards:
  - "playsound: ENTITY_PLAYER_LEVELUP;1;1"
  - "message: &7Congrats on finishing your first level! You earned &a$500 &7and &e1 diamond&7."
  - "console_command: eco give %player% 500"
  - "console_command: give %player% diamond 1"
```
