Skip to content

Localisation

Peter Crew edited this page Jan 1, 2017 · 1 revision

Localisation is something that has been briefly touched on so far in these tutorials but has not been covered in any detail. It is very important and useful, so make sure you take a look at it.


Many mods usually support multiple languages for their items, blocks, creative tabs, etc as it allows the users of them to feel more engaged as well as allowing the items to fit in a lot better into vanilla Minecraft. It is not necessary but is a nice touch and can make your mod seem a lot more user-friendly.

All language related features use the LanguageRegistry object to add translations (the base name uses exactly the same system). However, different types of entries have different functions:

Entry Function
Blocks addBlockEntry
Items addItemEntry
Creative Tabs addTabEntry
Potion effects addPotionEntry
Enchantments addEnchantmentEntry
Entities addEntityEntry

These functions all work in the same way - they take a locale code, the ID of the entry and the translation. For example (if an item has been registered under burningStick):

// english
LanguageRegistry.addItemEntry("en_US", "burningStick", "Burning Stick");
// german
LanguageRegistry.addItemEntry("de_DE", "burningStick", "Brennender Stock");

That's all there really is to localisation - exactly the same method is used for all entry types but with different functions. In the next tutorial, I'll be showing you how to add your own blocks to the game.

Clone this wiki locally