> For the complete documentation index, see [llms.txt](https://docs.xandtech.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xandtech.fr/home/xplayerexp/features/custom-commands.md).

# Custom Commands

Every command keyword in XPlayerEXP — the main command, its aliases, and each subcommand — is read from config rather than hardcoded, so a server can run the plugin entirely in its own language or house style without touching a single Java file.

## The main command & aliases

`config.yml`:

```yaml
commands:
  main: "bottlexp"
  commands-alias-enable: true
  aliases:
    - "xexp"
    - "expbottle"
```

* `main` is the primary command name, registered dynamically at startup (no `plugin.yml` command declaration to edit).
* `commands-alias-enable` turns the whole `aliases` list on or off at once, without having to delete the list itself.

{% hint style="warning" %}
Changing `main` or `aliases` only takes effect on a **plugin/server restart** — the dynamic command registration (via reflection into the server's command map) happens once, at startup. `/bottlexp reload` does **not** re-register the command.
{% endhint %}

## Subcommand keywords

```yaml
commands:
  subcommands:
    create: "create"
    give: "give"
    reload: "reload"
    doublexp: "doublexp"
```

Rename any of these — e.g. `create: "creer"` for a French server — and both the command handler and the tab-completer pick it up **immediately**, no restart needed (a plain `/bottlexp reload` is enough, since these are read from `config.yml` on every command execution rather than cached at startup).

{% hint style="info" %}
Renaming a subcommand keyword doesn't change its **permission node** — `xplayerexp.bottle.create` still gates the "create" action no matter what word triggers it. See [Permissions](/home/xplayerexp/reference/permissions.md).
{% endhint %}

## The Double XP sub-arguments

`doublexp.yml` has its own pair, independent from the `commands.subcommands.doublexp` keyword above:

```yaml
commands:
  start: "start"
  end: "end"
```

These are the literal words expected as `/bottlexp doublexp <start|end>`'s second argument — see [Double XP Events](/home/xplayerexp/features/double-xp.md).

## Putting it together

With:

```yaml
commands:
  main: "xp"
  subcommands:
    create: "creer"
    give: "donner"
```

...players would run `/xp creer <amount>` and `/xp donner <player> <amount>` instead of the defaults — while `/xp reload` and `/xp doublexp` stay as-is, since only `create`/`give` were renamed in this example. The in-game help menu (`/bottlexp` with no arguments) and tab-completion both reflect the renamed keywords automatically.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.xandtech.fr/home/xplayerexp/features/custom-commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
