# Commands & Permissions

## 🧾 Commands & Permissions <a href="#commands-and-permissions" id="commands-and-permissions"></a>

### 📘 Introduction <a href="#introduction" id="introduction"></a>

This page provides a complete list of all **commands** and their associated **permissions** for the **NameGradient** plugin.

Commands are split into two categories:

* **Player Commands** – for regular users.
* **Admin Commands** – for staff or server operators.

***

## 🎮 Player Commands

<table><thead><tr><th width="228">Command</th><th width="254.33333333333331">Description</th><th>Permission Node</th></tr></thead><tbody><tr><td><code>/gradient</code></td><td>Opens the main gradient menu.</td><td><code>namegradient.open</code></td></tr></tbody></table>

***

***

## 🛠️ Admin Commands

<table><thead><tr><th width="268">Command</th><th width="240.33333333333331">Description</th><th>Permission Node</th></tr></thead><tbody><tr><td><code>/namegradient help</code></td><td>View help message</td><td><code>namegradient.help</code></td></tr><tr><td><code>/namegradient info [player]</code></td><td>Check a player's information</td><td><code>namegradient.info</code></td></tr><tr><td><code>/namegradient reload</code></td><td>With this command you can reload the configuration files.</td><td><code>namegradient.reload</code></td></tr><tr><td><code>/namegradient remove (type) [player]</code></td><td>Remove specific player data</td><td><code>namegradient.remove</code></td></tr><tr><td><code>/namegradient removeall (player)</code></td><td>Completely eliminate a player.</td><td><code>namegradient.removeall</code></td></tr><tr><td><code>/namegradient set (type) [player] {ID} [Optional Styles]</code></td><td>Set a gradient to an online or offline player</td><td><code>namegradient.set</code></td></tr><tr><td><code>/namegradient transfer (type) [From] [To]</code></td><td>Transfer data from one player to another</td><td><code>namegradient.transfer</code></td></tr><tr><td><code>/namegradient openmenu [player] [Type]</code></td><td>Allows you to open menus to connected players.</td><td><code>namegradient.open</code></td></tr><tr><td><code>/namegradient export (value)</code></td><td>Exports the data stored in the database in a json file.</td><td><code>namegradient.export</code></td></tr><tr><td><code>/namegradient import (value)</code></td><td>Import the json file that is generated when exporting.</td><td><code>namegradient.import</code></td></tr></tbody></table>

​

***

## 📂 Custom Menu Commands

These commands allow direct access to specific plugin menus through configurable commands.\
You can enable or disable each command, define aliases, set permissions, and choose which menu to open.

Each custom command is defined in the `custom-commands` section of the config file.

#### 🔧 Configuration Example

```yaml
custom-commands:
  chat-gradient:
    enabled: true
    name: chatcolor
    aliases:
      - "ccolor"
      - "chatg"
    permission: gradient.chat.open
    open-menu: "gradientchat"
```

#### 🧩 Explanation of Fields

* `enabled`: Whether the command is active (`true` or `false`).
* `name`: The actual command players will use (e.g. `/chatcolor`).
* `aliases`: Optional alternative names (e.g. `/ccolor`, `/chatg`).
* `permission`: The permission node required to execute the command.
* `open-menu`: The ID of the menu to open. Options: `main`, `gradientchat`, `gradientname`, `history`.

#### ✅ Example

With the configuration above, a player with the `gradient.chat.open` permission can open the **Chat Gradient Menu** by using:

```
/chatcolor
/ccolor
/chatg
```

### 📋 Field Summary Table

| Field        | Type    | Description                                                                              |
| ------------ | ------- | ---------------------------------------------------------------------------------------- |
| `enabled`    | Boolean | Enables or disables the custom command.                                                  |
| `name`       | String  | Main command name players will use.                                                      |
| `aliases`    | List    | Alternative command names players can use.                                               |
| `permission` | String  | Required permission node for the player to use the command.                              |
| `open-menu`  | String  | ID of the menu to open. Valid values: `main`, `gradientchat`, `gradientname`, `history`. |

***

## 🕘 History Permissions

The `history` menu displays previously used gradients.\
To control how many entries a player can view, use the permission format:

```
namegradient.history.amount.<number>
```

Where `<number>` is the **maximum number of entries** the player can see.

The plugin will check for an exact permission match, and if not found, it will look for the **next highest available value**, up to **28**, which is the hard limit of the menu.

**✅ Example Permissions**

| Permission                       | Description                                 |
| -------------------------------- | ------------------------------------------- |
| `namegradient.history.amount.3`  | Allows viewing up to 3 previous gradients.  |
| `namegradient.history.amount.10` | Allows viewing up to 10 previous gradients. |
| `namegradient.history.amount.28` | Allows viewing the full history (28 items). |

> ℹ️ If the player does not have any permissions, the downgrades will not be stored.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.xshyo.us/premium-plugins/namegradient/commands-and-permissions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
