Donations will help me to keep up the work. It's a way for you to support me, and saying me thanks ;)
PlayerLanguageAPI is a little API I wrote while getting bored, that make the task easier for devs to allow players having a language. THIS PLUGIN IS AN API ONLY AND DOES NOTHING ON ITS OWN. Except allowing players to select their language.
There is only 3 usable methods, that are :
LanguageAPI.getLanguage(player);
It does return a value of type Languages that represent the actual selected language of the player player.
LanguageAPI.getStringLanguage(player);
It does return the player language as a string in lower cases. It's the same as doing LanguageAPI.getLanguage(player).toString().toLowerCase();
LanguageAPI.setLanguage(player, Languages.FRENCH);
This will set the selected language of the player player to french.
Provided events:
Spoiler
PlayerChangeLanguageEvent
Methods:
Spoiler
- getOldLanguage() : Return the language of the player before the change (Return type of Languages)
- getNewLanguage() : Return the language of the player after the change (Return type of Languages)
- getPlayer() : Return the player (Return type of Player)
When doing so, you can check, for example, if the player is english or german then send him an english or german message depending on what is his language.
This plugin also open a language selection menu when a player right-click with a nametag that :
- Have a display name
- Its display name doesn't start with §o (the italic code)
UPDATE 0.3: Now there is also the command /languages. You can enable or disable both of them in the config!
Below are listed all the supported languages:
- French
- English
- Dutch
- German
- Spanish
- Italian
- Portuguese
- Arabic
- Polish
- Chinese
I hope this API will be useful, any feedback / comment / idea / suggestion will be appreciated!
To-do list:
- Fix typos in the languages name in the Languages enum. (This will include that every config with portuguese messages will need to fix the typo too, for example)
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta