# Command detection

A small module that can detect players executing certain commands.

### Configuration

```yaml
command-detection:
    enabled: true
    command-groups:
        - commands:
            - op
            - deop
            - lp
          actions: []
```

We can group certain commands and link actions to them.

### Actions

You can link actions whenever a player tries to execute a command inside the configured command-group.

Actions listed here should be in the [Staff ++ command format](/general-information/other/configuring-commands.md)

#### Placeholders:

| Placeholder value | Description                                            |
| ----------------- | ------------------------------------------------------ |
| %player%          | The playername of the player that executed the command |
| %command%         | The exact command the player tried to execute          |

#### Targets/Executors

|        |                                              |
| ------ | -------------------------------------------- |
| player | The player that tried to execute the command |

### Alerts

In addition players can also be notified about the commands being executing through the [alerts module](/features/alerts.md).

```yaml
alerts-module:

  # Whether or not staff will be notified when the command-detection gets triggered.
  command-detection: true
  command-detection-console: false
```


---

# 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://wiki.staffplusplus.org/features/command-detection.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.
