Skip to content

Languages

Pavel Erokhin edited this page Nov 9, 2026 · 2 revisions

Every player reads Mo’Afks in their own language, and broadcasts reach everyone in theirs. English, Russian, Spanish, Portuguese, and German come bundled.

How a player gets their language

The plugin goes down this list and stops at the first match:

  1. The player’s choice. A player who picked a language with /moafks language <code> always gets it. /moafks language auto hands the choice back to the plugin.
  2. The sources in locales.sources, in order:
    • ip: the country of the player’s IP address. locales.countries maps languages to country codes: Russia, Belarus, and Kazakhstan get Russian; Spain and Latin America get Spanish; Brazil and Portugal get Portuguese; Germany, Austria, and Switzerland get German.
    • client: the language set in the player’s game, when a file in lang/ matches it.
  3. The default. Everyone else gets locales.default, English out of the box.

Check what a player got with /moafks locale <player>.

The country database

The country lookup needs no account and sends no address anywhere. On the first start, the plugin downloads DB-IP’s free “IP to Country Lite” database (4 MB, 8 MB unpacked) into plugins/MoAfks/geoip/ and refreshes it every 30 days. Lookups happen on your server.

Players who connect through a proxy or a relay show up with its address, so they get the relay’s country. Put client first in locales.sources, or let those players pick with /moafks language.

IP Geolocation by DB-IP, licensed under CC BY 4.0.

Add a language

  1. Copy lang/en.yml to, say, lang/it.yml and translate it.
  2. Add a line to locales.countries: it: [ IT, SM, VA ].
  3. Run /moafks reload.

Edit the messages

The files in lang/ use MiniMessage: colors, gradients, clickable links.

  • A key missing from a language file comes from the default language.
  • An empty string turns a message off for that language.
  • <player>, <display_name>, <reason>, and <time> fill in where a message uses them, and each file’s header lists them.
  • <papi:name> shows PlaceholderAPI’s %name%, and MiniPlaceholders tags work too, both for the player the message is about. See Integrations.

A player’s own words, like their name or an AFK reason, stay plain text, so nobody can slip tags into a message.

When an update adds a message, the changelog names the new keys. If you keep your own language files, add them. Until then they come from the bundled English.

Next: Integrations

Clone this wiki locally