> For the complete documentation index, see [llms.txt](https://realisticnode.gitbook.io/rnsetups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://realisticnode.gitbook.io/rnsetups/rnchatgames/configuration/messages.md).

# Messages and languages

Every text players see is in `languages/<language>.yml`: chat messages, game announcements, titles, boss bar, action bars, toasts, menus and the editor. English (`en.yml`) and Spanish (`es.yml`) are included. Choose one with `language` in `config.yml`.

## Formatting

* MiniMessage: `<green>`, `<#ff8800>`, `<gradient:#ff5f6d:#ffc371>`, `<bold>`, `<click:run_command:'/spawn'>`, `<hover:show_text:'Hi'>`, `<newline>`
* Legacy: `&a`, `&l`, `&#ff8800`
* `<center>` at the start of a line centers it in the chat (see `chat-width` in `config.yml`).
* `{prefix}` and `{header}` come from `config.yml`.
* PlaceholderAPI placeholders work in the texts when PlaceholderAPI is installed.

A text can be one line or a list of lines:

```yaml
game-stopped: '{prefix}<gray>The game was stopped.'
help:
  - ''
  - '<center><gold>rnChatGames'
```

An empty list (`[]`) or `''` sends nothing.

## Game announcements

Under `games:` there is a `default:` block and one block per game. A key missing in a game uses the one from `default`, so a game only needs the texts that are different.

| Key                                                        | When                                                                                                              |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| `start`                                                    | The game starts                                                                                                   |
| `correct`                                                  | Someone wins (games with 1 winner)                                                                                |
| `correct-place`                                            | Each place of a game with several winners (short; the answer is shown at the end)                                 |
| `ended`                                                    | End of a game with several winners. `{podium}` on its own line writes one line per winner (format: `podium-line`) |
| `timeout`                                                  | Time is up and nobody won                                                                                         |
| `stopped`                                                  | An admin used `/rncg stop`                                                                                        |
| `hint`                                                     | The hint is shown                                                                                                 |
| `title`, `subtitle`                                        | Title when it starts (both `''` = no title)                                                                       |
| `bossbar`, `actionbar`                                     | Countdown texts                                                                                                   |
| `win-title`, `win-subtitle`                                | Title of the winner                                                                                               |
| `win-others-title`, `win-others-subtitle`, `win-actionbar` | For everyone else when someone wins                                                                               |
| `toast`                                                    | Text of the winner's popup (`''` = no toast for that game)                                                        |
| `end-title`, `end-subtitle`, `end-actionbar`               | When a game ends with winners                                                                                     |
| `timeout-title`, `timeout-subtitle`, `timeout-actionbar`   | When time runs out and nobody won                                                                                 |
| `bedrock-title`, `bedrock-content`                         | Window of Bedrock players                                                                                         |

What is shown (titles, action bars, toast) is turned on and off in `config.yml` → `display`.

### Placeholders in game texts

| Placeholder                                                                     | Where                               |
| ------------------------------------------------------------------------------- | ----------------------------------- |
| `{game}`, `{question}`, `{answer}`, `{time_limit}`, `{max_winners}`, `{points}` | Every game text                     |
| `{player}`, `{display_name}`, `{time}`, `{place}`, `{place_name}`               | `correct`, `correct-place`, `win-*` |
| `{winners}`, `{podium}`                                                         | `ended`, `end-*`                    |
| `{hint}`                                                                        | `hint`                              |
| `{time_left}`                                                                   | `bossbar`, `actionbar`              |

Each game adds its own, explained above its block: `{word}` (word games), `{equation}` and `{difficulty}` (Math), `{equations}` (Variable), `{options}` and `{answer_letter}` (Multiple Choice), `{target}` and `{buttons}` (Click), `{min}` and `{max}` (Guess The Number), `{phrase}` (Completion).

## Other useful keys

| Key                                                                        | Text                                                                                                                                            |
| -------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `game-names.<game>`                                                        | Name of each game (`{game}`)                                                                                                                    |
| `place-names`                                                              | `1st`, `2nd`, `3rd`... (`{place_name}`)                                                                                                         |
| `wrong-answer`, `wrong-answer-last`, `wrong-click-last`, `out-of-attempts` | Answers about your own attempts                                                                                                                 |
| `wrong-case`                                                               | "Almost! Check the capital letters."                                                                                                            |
| `guess-higher`, `guess-lower`                                              | Guess The Number hints                                                                                                                          |
| `new-record`, `first-record`, `streak`, `streak-ended`                     | Announcements                                                                                                                                   |
| `pending-rewards`                                                          | Rewards received after joining                                                                                                                  |
| `next-game.*`                                                              | `/rncg next` and its placeholder                                                                                                                |
| `top-*`, `stats`, `logs-*`, `list-*`                                       | Text versions of the commands                                                                                                                   |
| `menus.*`                                                                  | Every menu text (see [Menus](/rnsetups/rnchatgames/configuration/menus.md) and [In-game editor](/rnsetups/rnchatgames/configuration/editor.md)) |

## Adding a language

1. Copy `languages/en.yml` as `languages/fr.yml` and translate it.
2. Set `language: fr`.
3. Optionally copy `content/en.yml` as `content/fr.yml` too (see [Words and questions](/rnsetups/rnchatgames/configuration/content.md)).

A language made by you gets the new messages of future updates in English, so nothing is ever missing.

## Language of each player

With `per-player-language: true` in `config.yml` (or `/rncg editor` → General) every player gets the messages, titles, boss bar, action bar and menus in the language of their Minecraft client, when the plugin has that file:

* The exact file (`pt_br.yml`) or the language part (`es_mx` → `es.yml`) is used.
* Players whose language has no file see `language`.
* The console always uses `language`.
* The same for everybody: the words and questions of the games (`content/`), the toast popup and the texts of `rewards.yml`.

{% hint style="warning" %}
It is off by default. If you customize your texts, do it in every language file you have, or players with another client language will see the default texts.
{% endhint %}
