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

# Custom Commands

Unleash the full potential of your server with the ability to Create Your Own Commands. Tailor your server's functionality to suit your community's needs, from simple message commands to complex gameplay mechanics, enhancing interactivity and personalization.

Tab complete is integrated and supported!

{% code title="commands/report.yml" lineNumbers="true" fullWidth="true" %}

```yaml
baseCommand: /report
description: Report player

command:
  - effects:
      - "MESSAGE:&cCommand usage: /report <player> <reason>! <condition>%arg length% < 2 : %allow%</condition>"
      - "BROADCAST_PERMISSION:advancedchat.admin:&c[Report] %player name% &fhas reported &c%arg-1% &ffor &c%arg-2-END% <condition>%arg length% >= 2 : %allow%</condition>"
      - "MESSAGE:&fYour report has been submitted! Thank you for helping us keep the server clean! <condition>%arg length% >= 2 : %allow%</condition>"

invalidArgs:
  - effects:
      - "MESSAGE:&cCommand usage: /report <player> <reason>!"
```

{% endcode %}

## Configuration Explained

* **baseCommand**: Specifies the command to be used, in this case, `/report`.
* **description**: A brief description of what the command does, useful for documentation and help menus.

### **`command` Section**

This section outlines what happens when the command is executed correctly. It uses a list of `effects` , you can find all effects here: <https://wiki.advancedplugins.net/abilities/effects>

### **`invalidArgs` Section**

Defines actions to take when the command is used with incorrect arguments, typically to inform the player of the correct usage.

#### Additional Notes

* **Argument Variables**: Use placeholders like `%arg-1%` for the first argument or `%arg-1-4%` for arguments one to four. `%arg-2-END%` captures all arguments from the second to the last, useful for commands needing variable input lengths.
* **Conditions**: Are specified within `<condition>` tags, allowing certain effects to be conditional on the command's input.
* **Disabling Commands**: Change the file extension (e.g., from `.yml` to `.yml.off`) to disable specific commands without deleting them, providing flexibility in command management.


---

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

```
GET https://chat.advancedplugins.net/features/custom-commands.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.
