Messages and Colors
On this page(13)
Every text SnDungeons sends lives in a language file you can restyle line by line. The global
messages are in lang/messages_en.yml, and each module keeps its own next to its config. Your edits
survive updates: a newer jar only adds the keys you are missing.
| Global messages | lang/messages_en.yml |
| Module messages | modules/<id>/lang/messages_en.yml (keys served as <id>.<key>) |
| Language switch | lang: of config.yml |
| Apply an edit | /dungeons reload |
The language files
The global file
lang/messages_en.yml has four top-level parts:
| Part | What it holds |
|---|---|
prefix | The text put in front of every single-line message |
snlib | The shared command messages of every Sn plugin (no permission, usage, help...) |
messages | The messages of the core: currencies, levelings, boosters, pouches, tops, settings, shops, luck, the admin commands... |
status | Short state words reused by many messages and placeholders |
At runtime a fifth part appears: the commands: block, the help texts of every command. See
Command help texts.
Each message has a comment above it that names its placeholders, such as {player} or {amount}.
Module files
Each module has modules/<id>/lang/messages_en.yml. Its keys are served under the module id, so
go.done of the zones file is the message zones.go.done. The file exists while the module has
enabled at least once.
A module message never overrides a global one. When both files define the same key path, the global file wins and the console warns once.
The prefix
prefix: "₢f2&lSnDungeons &8| &7"- The prefix is put in front of every single-line message automatically.
- A message written as a YAML list is sent line by line, without the prefix.
- Start a line with
[noprefix]to send that one line without the prefix. - Never write
{prefix}in a message: it would show as written, and the console warns.
# lang/messages_en.yml, messages.menus.no-menu: one line, with the prefix.
no-menu: "&cThe {menu} menu is not available."
# lang/messages_en.yml, messages.modules.entry: one line, without the prefix.
entry: "[noprefix]&8 - &f{name} &8(&7{id}&8) {state}"
# modules/hunts/lang/messages_en.yml, complete: several lines, no prefix.
complete:
- ''
- '[center]&e&lHunt Completed'
- '[center]&7You have completed the {difficulty} &f{hunt} &7hunt'
- '[center]&7Claim it in &e/hunt'
- ''A message set to '' sends nothing. Many messages document that as the way to switch them off.
Colors and formats
SnDungeons texts accept three styles, mixed freely in one line.
| Style | Example | Result |
|---|---|---|
| Legacy codes | &a, &c, &l, &o, &r | Green, red, bold, italic, reset |
| Hex colors | :d62c | Any RGB color |
| MiniMessage tags | <red>, <bold>, <gradient:#ff0000:#0000ff>text</gradient> | Colors, formats and gradients |
name: ':d62c&lBarn &#b6fdb0&lZone'
header: "<gradient:#8354f2:#b59cff>Your boosts</gradient>"A color code ends the bold, italic and other formats before it, as in vanilla. So &l&c is red
without bold, and &c&l is bold red. Put the format after the color.
MiniMessage hover and click tags work in chat messages too:
hint: "<hover:show_text:'<gray>Opens the menu'><click:run_command:/zones><green>Click here</click></hover>"Line tags
These tags go at the start of a line:
| Tag | What it does |
|---|---|
[center] | Centers the line in the chat |
[rgb] | Paints the line with a rainbow gradient (magenta to orange red). Colors written in the line are replaced, formats stay |
[small] | Writes the letters in small caps (ꜱᴍᴀʟʟ ᴄᴀᴘꜱ) |
[noprefix] | Sends the line without the prefix |
They combine in any order: [center][rgb]&lLEVEL UP. [rgb] and [small] also work in the middle
of a line, closed by [/rgb] and [/small].
Placeholders in messages
- Local placeholders in braces, such as
{player},{amount}or{zone}. The comment above each message lists the ones it takes. An amount followscurrencies.number-formatofconfig.yml. - PlaceholderAPI placeholders, such as
%player_name%or%sndungeons_level_level%. They resolve for the player who receives the message, when PlaceholderAPI is installed.
Local placeholders are filled first, so a local value may itself hold a %...% placeholder.
Translating
Set the language code in config.yml:
lang: es- Copy
lang/messages_en.ymltolang/messages_es.ymland translate the values. - For each module you want translated, copy
modules/<id>/lang/messages_en.ymltomessages_es.ymlin the same folder. - Run
/dungeons reload.
How the fallback works:
| Situation | What happens |
|---|---|
lang/messages_<code>.yml does not exist | The English file is used, with one warning |
| A key is missing from your translation | Its English value is used, with one warning per key |
| A module has no translation file | That module uses its English file, with one warning |
| A newer jar adds keys | They are added to your translation from the English file, with one console line asking you to translate them |
Keep messages_en.yml in place: it is the reference for every translation.
Missing messages
A key that exists in no file shows as <missing:key> in game, with one warning per key. It happens
when update-configs: false keeps a newer jar from adding a message. Add the key by hand, or start
once with update-configs: true.
The status words
The status: section holds short words that many messages and placeholders reuse, so one edit
restyles them everywhere.
status:
enabled: "&aEnabled"
disabled: "&cDisabled"
permanent: "&7permanent"
time-day: "d"
time-hour: "h"
state-locked: "&cLocked"
state-maxed: "&6Maxed"| Group | Examples | Where it shows |
|---|---|---|
| Module states | enabled, disabled | /dungeons admin modules |
| Time letters | time-day, time-hour, time-minute, time-second | Every time left, like 1d 2h 30m |
| Boost words | permanent, target-off, paused, stacking-additive, stacking-multiplicative | Boost lists and placeholders |
| State words | state-<word> | The _state_label placeholders, such as %sndungeons_zone_barn_state_label% |
The _state placeholders give a stable word (locked, current, maxed) that menus compare. The
matching _state_label placeholder gives the text of status.state-<word>. Change the label freely,
never the word.
The snlib block
snlib: holds the messages of the command system that every Sn plugin shares:
| Key | When it shows |
|---|---|
snlib.no-permission | A command you lack the permission for |
snlib.usage | A command typed with missing arguments |
snlib.invalid-number, snlib.invalid-value, snlib.out-of-range, snlib.number-too-small | A wrong argument |
snlib.player-not-found | An unknown player name |
snlib.unknown-subcommand | A subcommand that does not exist |
snlib.reload-done | After /dungeons reload |
snlib.help.header, entry, footer, group-header, group-footer | The generated help pages |
This block is always merged, whatever update-configs says. Restyle the values freely. A key you
delete comes back on the next start with a plain, unbranded default.
Command help texts
On every start and reload, SnDungeons writes the help text of every command into a commands:
block of lang/messages_en.yml. Edit those texts to restyle or translate the help.
commands:
<root>:
description: <the help line of /<root>>
subcommands:
<sub>:
description: <the help line of /<root> <sub>>
args:
<arg>: <the label of <arg> in the usage line>- Only the descriptions and the argument labels change. The names players type never change here.
- An empty value keeps the default text.
- A new command adds its entry, and
/dungeons reloadapplies your edits.
This block is merged whatever update-configs says, like snlib:.
Tips
- Restyle one module at a time and run
/dungeons reloadafter each file. - Keep the placeholders of a message: removing
{amount}removes the amount from the text. - To silence a message, set it to
''instead of deleting the key. A deleted key comes back with the next merge. - Use
[noprefix]for list lines and headers, as the shipped files do.