---
description: >-
  This is a guide to learn how to add a page system in chat for your command aid
  system.
---

# CommandHelp

### What is CommandHelp ?

`CommandHelp` is a class which allows you to create a **pages in chat** for your **command aid system**. This page system allows you, when you have a lot of commands, to display their usage in a **structured** way to the user.

{% hint style="info" %}
A `CommandUsage` must be created to use this feature.
{% endhint %}

### How to create a CommandHelp ?

At this point, you should have something like this in your command resource file.

{% hint style="info" %}
Remember that my command's name is `item` so I will write the following codes into the `command_item.json` file.
{% endhint %}

```java
{
  "item": {}
}
```

To create a `CommandMessage`, write the following code into the item section:

```javascript
"commandHelp": {}
```

So you should have something like this:

```javascript
{
  "item": {
    "commandHelp": {}
  }
}
```

#### CommandHelp properties

Let's see the available properties of the `commandHelp` section:

| Type              | Property   | Description                                                                                         |
| ----------------- | ---------- | --------------------------------------------------------------------------------------------------- |
| `minOfCommands`   | `int`      | The min number of commands to show page system, top and bottom messages                             |
| `commandsPerPage` | `int`      | The max number of commands per page                                                                 |
| `previousPage`    | `String[]` | The previous page (see [here](indications#for-the-previous-page) for more information)              |
| `nextPage`        | `String[]` | The next page (see [here](indications#for-the-next-page) for more information)                      |
| `pagination`      | `String[]` | The page system format (see [here](indications#pagination-format-indications) for more information) |
| `format`          | `String[]` | The help message format (see [here](indications#general-help-format) for more information)          |

#### Example

```javascript
{
  "item": {
    "commandHelp": {
      "minOfCommands": 3,
      "commandsPerPage": 4,
      "previousPage": ["&7[&b<&7]", "&bPrevious page", "&7[<]", ""],
      "nextPage": ["&7[&b>&7]", "&bNext page", "&7[>]", ""],
      "pagination": [" ", "%previous_page%", " ", "%next_page%", " &6- &ePage ", "%page%"],
      "format": [
        "&6----------------------------",
        " ",
        "%usages%",
        " ",
        "%pagination%",
        " ",
        "&6----------------------------"
      ]
    }
  }
}
```
