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

# Configuration

## General

```yaml
modules:
  # Allows to create custom commands with args, cooldown and actions.
  # The chat reload does not apply to the Custom Commands module,
  # you must restart the server if you make any changes or if you add or remove commands.
  #
  # Custom Commands module loaded from modules/customcommands/*.yml
  custom-commands: true
```

* modules.custom-commands: Enable/disable the module.

***

## Module

#### Name

```yaml
name: heal
```

The primary name of the command.

This is the command players will execute.

### Aliases

```yaml
aliases:
  - healme
```

Alternative names that execute the same command.

***

### Arguments

```yaml
args:
  min: 0
  max: -1
  usage: "/heal"
  usage-actions:
    - "[MESSAGE] <red>Usage: {usage}"
```

Defines how many arguments the command accepts.

#### Min

Minimum number of required arguments.

#### Max

Maximum number of allowed arguments.

Use `-1` to allow unlimited arguments.

#### Usage

Usage message shown to the player through `{usage}`.

#### Usage-actions

Actions executed when the player provides an invalid number of arguments.

***

### Permission

```yaml
# - Remove or leave blank to allow everyone
permission: "tchat.command.heal"
no-permission-actions:
  - "[MESSAGE] <red>You don't have permission to use /heal."
```

Permission required to execute the command.

Remove this option or leave it empty to allow every player to use the command.

### Cooldown

```yaml
cooldown: 30
cooldown-actions:
  - "[MESSAGE] <yellow>You must wait <bold>{remaining}s</bold> before using /heal again."
```

Cooldown in seconds before the player can use the command again.

Set to `0` to disable the cooldown.

### Actions

Check actions [here](/general/actions.md).

```yaml
# Actions on success
# {arg0} = the destination the player typed
# {args} = all arguments joined by space
# {player} = player name
actions:
  - "[CONSOLE_COMMAND] effect give {player} instant_health 1 255 true"
  - "[MESSAGE] <green>You have been healed!</green>"
  - "[SOUND] entity.player.levelup"
```

### Available placeholders

| Placeholder | Description                                |
| ----------- | ------------------------------------------ |
| `{player}`  | Player executing the command.              |
| `{arg0}`    | First argument.                            |
| `{arg1}`    | Second argument.                           |
| `{arg2}`    | Third argument.                            |
| `{args}`    | All arguments joined into a single string. |
