MinionCore logoMinionCore

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.yml

language in config.yml picks the file, written without .yml:

language: fr_FR
ValueLanguage
en_USEnglish, the default
fr_FRFrench
es_ESSpanish

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

SectionWhat it covers
prefixThe text put in front of most messages
generalPermission, 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
placementPlacing 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
pickupPicking a minion up, and failed when the database could not save it
fuelAdding fuel and running out
upgradeUpgrades, buying levels, payment problems, and needs-max-level when upgrades wait for the highest level
breakdownA minion breaking down, being repaired, and repairing one that is not broken
storageTaking and selling stored items
saplingsThe lumberjack sapling store: wrong item, full store, not replanting
experienceCollecting stored experience
accessOwner checks and the trust list
collectorPairing minions with chunk collectors, unpairing, and switching what a collector collects
inputChat prompts, cancelling and timing out
statusThe status words shown in holograms and menus, including broken
shopBuying from the shop
claimItems waiting to be collected. waiting is sent when a player joins and items are still waiting after the hand over
listThe /minion list output
help and admin-helpThe paginated help pages, their command descriptions, the arguments typed after each label and the per-page row count. See Help lines
adminAdmin command output
menuShort 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
filterAdding to a filter
block-filterAdding and removing blocks in a minion's block filter, a full list, and an item that is not a block
placeholdersText 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 showsWhat works
Chat messagesEverything, including hover and click
Item names, lore, menu titles, hologramsColours 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 asExampleWhat it does
& and a code&a, &l, &rThe colours 0 to 9 and a to f, plus k, l, m, n, o for styles and r to reset
&#rrggbb&#e0a526A hex colour
&x&r&r&g&g&b&b&x&e&0&a&5&2&6A 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.labels or command.admin-labels in config.yml,
  • the arguments under help.arguments.<id> or admin-help.arguments.<id>,
  • the description under help.descriptions.<id> or admin-help.descriptions.<id>.
lang/en_US.yml
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.

  1. The selected file in your lang folder.
  2. The shipped copy of that language inside the jar. Only en_US, fr_FR and es_ES have one.
  3. lang/en_US.yml in your plugin folder.
  4. 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:

KeyNew shipped text in en_US.yml
placement.limit-reachedYou have reached your total minion limit. %placed%/%limit% placed across all types.
placement.type-limit-reachedYou have reached the limit for %type%. %placed%/%limit% of this type placed.
breakdown.brokeSame 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.

Select it

In config.yml, set:

language: de_DE

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.

On this page