# Configuration

The configuration file for command aliases can be found at `.minecraft/config/command-aliases-config.json`. The autogenerated configuration file should appear as follows:

```json5
{
  "database_settings": {
    "database_mode": "LEVELDB",
    "host": "localhost",
    "port": 3306,
    "database": "command_aliases",
    "user": "root",
    "password": ""
  },
  "debug_settings": {
    "debug_mode": false,
    "show_processing_time": false,
    "broadcast_to_ops": false
  }
}
```

## Database settings

You may be curious as to why a mod like Command Aliases would need or use a database at all. This feature was added to allow alias creators to create more complex commands by allowing them to store values, as there is not a proper way to do so using the vanilla system without causing significant performance penalties at a large scale.

### Supported databases

| Database mode | Description                                                             | Requirements                         |
| ------------- | ----------------------------------------------------------------------- | ------------------------------------ |
| `IN_MEMORY`   | Stores values in memory only. Data is lost when the game/server closes. | None                                 |
| `LEVELDB`     | Stores values locally in the game or world folder.                      | None                                 |
| `MYSQL`       | An implementation of MySQL.                                             | Host, Port, Database, User, Password |
| `REDIS`       | An implementation of Redis.                                             | Host, Port, User, Password           |

### Database configuration examples

* In-Memory Database

```json5
{
  "database_settings": {
    "database_mode": "IN_MEMORY"
  }
}
```

* LevelDB

```json5
{
  "database_settings": {
    "database_mode": "LEVELDB"
  }
}
```

* MySQL

```json5
{
  "database_settings": {
    "database_mode": "MYSQL",
    "host": "localhost",
    "port": 3306,
    "database": "command_aliases",
    "user": "root",
    "password": ""
  }
}
```

* Redis

```json5
{
  "database_settings": {
    "database_mode": "REDIS",
    "host": "localhost",
    "port": 6379,
    "user": "default",
    "password": ""
  }
}
```

## Debug settings

This section is primarily used to debug the creation of more complex command aliases.

```json5
{
  "debug_settings": {
    "debug_mode": true, // Displays errors when creating new custom commands
    "show_processing_time": true, // Shows the amount of time it takes to process each command and execute them
    "broadcast_to_ops": true // Whether commands will be broadcasted to operators
  }
}
```


---

# 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.commandaliases.flashyreese.me/configuration.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.
