Language Utils: Localization API for Minecraft Servers

Understanding Language Utils in Minecraft Every server owner and plugin developer has faced the frustration of retrieving a clean, localized name for an item. Vanilla Minecraft provides unlocalized strings like item.swordIron, but turning that into "Iron Sword" for a specific language used to be ...

Download LangUtils for Minecraft 1.10

Original name: LangUtils

Minecraft: 1.10

FileVersionLoaderSize
LangUtils-1.6.1.jar1.10—722 КБDownload

Understanding Language Utils in Minecraft

Every server owner and plugin developer has faced the frustration of retrieving a clean, localized name for an item. Vanilla Minecraft provides unlocalized strings like item.swordIron, but turning that into "Iron Sword" for a specific language used to be a clunky, manual process. Language Utils steps in as a lightweight Spigot/Bukkit API that solves this problem elegantly, offering a straightforward way to grab display names, localized names, and even enchantment details directly from the game's language files.

What Exactly Is Language Utils?

Language Utils is not a standalone plugin with visible in-game features. Instead, it acts as a library that other plugins can hook into. Its primary job is to read the vanilla language entries bundled with Minecraft and expose them through a simple helper class. Whether you need the English name of a diamond pickaxe, the Chinese name of a zombie, or the full Roman-numeral enchantment level, this API delivers it in microseconds.

The current major version targets Spigot/Bukkit 1.10.2, but older builds exist for versions 1.7.10, 1.8.9, and 1.9.4. The project is open source under the MIT license, and the code is available on GitHub along with an example plugin that demonstrates every method call.

Key Features at a Glance

  • Retrieve localized item names, including custom display names from anvils.
  • Translate entity names for any supported locale.
  • Fetch enchantment names and their levels with proper formatting.
  • Support for multiple languages based on the player's client settings.
  • Minimal performance impact—loading all language files takes only 100-250 ms.

Installation for Server Owners

Adding Language Utils to your server is as simple as dropping the JAR file into the plugins/ folder. The plugin itself has no commands or listeners; it silently loads language data and waits for other plugins to use its API. After installation, a new LangUtils/lang/ directory appears, containing a README.txt that explains how to customize or override any language entry. The initial load consumes a brief moment, but subsequent lookups are nearly instant.

If you prefer a more streamlined approach to managing server mods and plugins, the foxygame.net launcher provides a modern, flexible interface where you can download Language Utils directly from the menu. This saves you from manually searching for the correct version and makes keeping your server up to date remarkably easy.

Developer Setup

Plugin developers can integrate Language Utils by adding the API to their build path. The library is hosted in a Maven repository, so both Gradle and Maven users can pull it in with a few lines. For Gradle, include the repository and dependency in your build.gradle:

repositories {
    maven { url 'https://raw.github.com/MascusJeoraly/LanguageUtils/mvn-repo/' }
}
dependencies {
    compile group: 'com.meowj', name: 'LangUtils', version: '1.6.0'
}

Maven users can add this to their pom.xml:

<repositories>
    <repository>
        <id>lang-utils-repo</id>
        <url>https://raw.github.com/MascusJeoraly/LanguageUtils/mvn-repo/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>com.meowj</groupId>
        <artifactId>LangUtils</artifactId>
        <version>1.6.0</version>
    </dependency>
</dependencies>

Always check for the latest version number on the repository page.

Using the API in Your Plugin

Once the dependency is set up, you can call static methods from the LanguageHelper and LocaleHelper classes. The API is designed to be intuitive, mirroring the way you'd naturally think about localization.

Working with Items

Getting a player-friendly item name is a one-liner. To retrieve the English display name of an ItemStack:

LanguageHelper.getItemDisplayName(itemStack, "en_US");

If you want the name in the player's own language, pass the Player object instead of a locale string. The same pattern applies to localized names (without custom anvil names) and unlocalized raw keys.

Entities Made Easy

Entity names work similarly. You can get the unlocalized name of an entity type or a specific entity instance, then translate it. For a localized zombie name in French:

LanguageHelper.getEntityName(entity, "fr_FR");

The display name variant also respects name tags, so renamed mobs will show their custom moniker.

Enchantments and Their Levels

Enchantment handling goes beyond simple names. You can fetch the full display name including the level—for example, "Sharpness V". Use getEnchantmentDisplayName with an enchantment and level, and the API automatically appends the Roman numeral. If you need only the level translation (like "V" in Chinese), a separate method handles that.

Utility Methods

A generic translateToLocal method lets you convert any unlocalized string to a specific locale. To discover which language a player is using, call LocaleHelper.getPlayerLanguage(player). You can even register custom or replacement entries dynamically with LanguageRegistry.INSTANCE.registerEntry(...).

Configuration and Customization

The plugin creates a FallbackLanguage=en_US setting in its config. If a player's language cannot be determined or a translation is missing, the API defaults to American English. The LangUtils/lang/ folder contains all the vanilla language files, and editing them directly allows you to tweak any translation without touching code.

Known Limitations

Language Utils uses HashMaps and enums to store and retrieve translations, which keeps lookups fast—typically 50-1000 microseconds per item name. However, this approach does not natively support items from mods in versions 1.8 and above, since the API focuses on vanilla entries. The developer is open to suggestions for more efficient data structures if you encounter performance bottlenecks.

Why Language Utils Belongs in Your Toolkit

Localization often gets overlooked in the rush to add gameplay features, but it makes a huge difference in player experience. Language Utils strips away the complexity of reading language files manually and gives you a clean, consistent interface. Whether you're building a shop plugin that needs to display item names in multiple languages or an info command that shows entity details, this API saves you from reinventing the wheel. Its lightweight design, straightforward methods, and active maintenance make it a dependable choice for any Spigot server looking to speak the player's language.