Messages and language
How to pick a language, edit or switch off chat messages, format them with MiniMessage and add a language of your own.
Every chat message the plugin sends lives in a language file you can edit, so you can reword, recolour or translate anything players read in chat. English, French and Spanish ship ready to use, and adding another language is a matter of copying one file.
The lang folder
plugins/MinionCore/lang/
en_US.yml
fr_FR.yml
es_ES.ymllanguage in config.yml picks the file, written without .yml:
language: fr_FR| Value | Language |
|---|---|
en_US | English, the default |
fr_FR | French |
es_ES | Spanish |
Capital letters do not matter, fr_fr finds fr_FR.yml. Run /minion reload after changing it.
The language files hold chat messages, command help and status words. Menu titles and buttons are in gui.yml (see Menus). Item names and lore are in the type files, fuel.yml, upgrades.yml and shop.yml. Hologram lines are in each type file.
What is in a language file
| Section | What it covers |
|---|---|
prefix | The text put in front of most messages |
general | Permission, unknown command, unknown player and reload messages, the reload- summary lines for type changes on placed minions, and minion-busy for a minion that is still loading or being picked up |
placement | Placing a minion, the total and type limits, blocked spots, occupied and minion-in-the-way for a block a minion already holds, a missing or switched off type, and a placement that could not be set up |
pickup | Picking a minion up, and failed when the database could not save it |
fuel | Adding fuel and running out |
upgrade | Upgrades, buying levels, payment problems, and needs-max-level when upgrades wait for the highest level |
breakdown | A minion breaking down, being repaired, and repairing one that is not broken |
storage | Taking and selling stored items |
saplings | The lumberjack sapling store: wrong item, full store, not replanting |
experience | Collecting stored experience |
access | Owner checks and the trust list |
collector | Pairing minions with chunk collectors, unpairing, and switching what a collector collects |
input | Chat prompts, cancelling and timing out |
status | The status words shown in holograms and menus, including broken |
shop | Buying from the shop |
claim | Items waiting to be collected. waiting is sent when a player joins and items are still waiting after the hand over |
list | The /minion list output |
help and admin-help | The paginated help pages, their command descriptions, the arguments typed after each label and the per-page row count. See Help lines |
admin | Admin command output |
menu | Short values used inside menus, such as "Max", "None", "No limit", installed or not installed in the upgrades menu, the filter and block filter mode names, the collector modes, in range and out of range, the facing directions, and working or not working in the view menu |
filter | Adding to a filter |
block-filter | Adding and removing blocks in a minion's block filter, a full list, and an item that is not a block |
placeholders | Text the PlaceholderAPI placeholders return, such as "Unlimited" |
Words wrapped in percent signs, such as %type% or %amount%, are filled in by the plugin. Keep them when you reword a message. Each message's comment in the file says what it is for.
Formatting with MiniMessage
Messages use MiniMessage tags for colour and style. A tag opens a style, and a closing tag with a slash ends it.
placement:
placed: "<green>Your %type% was placed."
too-close: "<red>Another minion is too close. Keep at least <white>%distance%<red> blocks between them."Hex colours, gradients and bold text:
prefix: "<gradient:#e0a526:#f87171><b>Minions</b></gradient> <dark_gray>| <white>"
fuel:
ran-out: "<#ffe0a3>Your %type% has run out of fuel."Hover and click text work in chat:
claim:
inventory-full: "<yellow>Your inventory is full, the rest is still waiting. <hover:show_text:'<gray>Click to open the menu'><click:run_command:'/minion'><white>[Open]</click></hover>"| Where the text shows | What works |
|---|---|
| Chat messages | Everything, including hover and click |
| Item names, lore, menu titles, holograms | Colours and styles. Hover and click have nothing to act on there |
When PlaceholderAPI is installed, its placeholders work in messages sent to a player.
Legacy colour codes
Old style colour codes work too, anywhere MiniMessage works: messages, item names and lore, menu titles and holograms. They can be mixed with MiniMessage tags in the same line.
| Written as | Example | What it does |
|---|---|---|
& and a code | &a, &l, &r | The colours 0 to 9 and a to f, plus k, l, m, n, o for styles and r to reset |
&#rrggbb | &#e0a526 | A hex colour |
&x&r&r&g&g&b&b | &x&e&0&a&5&2&6 | A hex colour in the long form some other plugins write |
placement:
placed: "&aYour &#e0a526%type% &awas placed. <gray>Right click it to open its menu."The same codes written with § instead of & work as well. An & that is not followed by a valid code is shown as it is, so text like Salt & Pepper is left alone. Codes that come back from a PlaceholderAPI placeholder are turned into colours too.
Help lines
Each line of /minion help and /minion admin help is put together from three parts:
- the label the command has right now, from
command.labelsorcommand.admin-labelsinconfig.yml, - the arguments under
help.arguments.<id>oradmin-help.arguments.<id>, - the description under
help.descriptions.<id>oradmin-help.descriptions.<id>.
help:
arguments:
help: "[page]"
list: "[page]"
shop: ""
remove: ""
pair: ""
admin: ""
admin-help:
arguments:
give: "<player> <type> [amount]"
list: "<player> [page]"Write only what comes after the label. Admin lines under admin get the admin label put in front for you, so admin-help.arguments.list is just <player> [page]. Because the label comes from config.yml, renaming a subcommand changes the help straight away.
Files from before lang-version: 3 had whole usage lines under help.usages and admin-help.usages. Those are no longer read and can be deleted.
The prefix
prefix is put in front of most messages, so every line from the plugin is easy to spot.
prefix: "<green>Minions <dark_gray>| <white>"Set it to "" to show no prefix. Lines that are part of a longer block (the headers, rows and footers of help pages and minion lists, and the debug output) are sent without it.
Switching a message off
Set any message to an empty string and it is not sent at all:
placement:
placed: ""
storage:
full: ""This works for every chat message. A value that is shown inside something else, such as a status word in a hologram or menu.max in a menu, just shows as blank.
Missing keys
If a key is missing from the selected file, the plugin looks for it elsewhere rather than showing nothing.
- The selected file in your
langfolder. - The shipped copy of that language inside the jar. Only
en_US,fr_FRandes_EShave one. lang/en_US.ymlin your plugin folder.- The built in English inside the jar.
If language names a file that does not exist, the console logs a warning and English is used.
When an update adds new messages, the shipped language files get the new keys merged in automatically. The shipped files are at lang-version: 6 in 1.0.0, see Configuration. A language file you made yourself does not, so new messages show in English until you add them.
The merge only adds keys that are missing. A message whose shipped text changed in an update keeps your old text, because the key is already in your file. In 1.0.0-3 that applied to these messages:
| Key | New shipped text in en_US.yml |
|---|---|
placement.limit-reached | You have reached your total minion limit. %placed%/%limit% placed across all types. |
placement.type-limit-reached | You have reached the limit for %type%. %placed%/%limit% of this type placed. |
breakdown.broke | Same text. %cost% now shows one total with no change to your file. The new %base_cost% and %upgrade_cost% only show if you add them |
Starting with 1.0.0-4, the update to lang-version: 5 replaces the two limit messages in en_US, fr_FR and es_ES for you, as long as your file still holds the old shipped text. A message you reworded yourself is left alone. In 1.0.0-5 the update to lang-version: 6 does the same for admin.ground-tags, which now names the protected scoreboard tag instead of "carries scoreboard tags, likely from another plugin". For anything else, delete the key from your language file and run /minion reload, or copy the line across by hand.
Adding your own language
Copy the English file
In plugins/MinionCore/lang, copy en_US.yml and name the copy after your language, for example de_DE.yml.
Translate the text
Change only the text inside the quotes. Keep every key name, and keep placeholders like %type% and %amount% as they are. You can delete the comments if you like.
Reload
Run /minion reload. New files in the lang folder are picked up without a restart.
After updating the plugin, compare your file with the newest en_US.yml and translate any keys that were added. Until you do, those messages show in English.