Repository navigation
Languages
Every player reads Mo’Afks in their own language, and broadcasts reach everyone in theirs. English, Russian, Spanish, Portuguese, and German come bundled.
The plugin goes down this list and stops at the first match:
-
The player’s choice. A player who picked a language with
/moafks language <code>always gets it./moafks language autohands the choice back to the plugin. -
The sources in
locales.sources, in order:-
ip: the country of the player’s IP address.locales.countriesmaps 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 inlang/matches it.
-
-
The default. Everyone else gets
locales.default, English out of the box.
Check what a player got with /moafks locale <player>.
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.
- Copy
lang/en.ymlto, say,lang/it.ymland translate it. - Add a line to
locales.countries:it: [ IT, SM, VA ]. - Run
/moafks reload.
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
Players and server owners
- Installation
- First steps
- How AFK works
- Commands and permissions
- Configuration
- Languages
- Integrations
- FAQ
Developers