MCLang
Github Status
SpigotMC Status
bStats Status
Lightweight API to load and use official Minecraft language pack translations.
*Tested Minecraft versions: 1.17, 1.18, 1.19, 1.20, 1.21*, 26.1
*Folia 1.19.4+ support (version 1.1.3 add)
Features
Web API & Frontend Portal (version 1.2.0 add)
MCLang includes a built-in modern Web API and an interactive frontend portal, making it easy to query translations programmatically or test them directly via your browser.
Enable and configure in plugins/MCLang/config.yml:
Accessing the Services
Gradle
Maven
Full Example: https://github.com/0obriano0/MCLang-example
Example
View updates and changelog here.
TODO
Github Status
SpigotMC Status
bStats Status
Lightweight API to load and use official Minecraft language pack translations.
*Tested Minecraft versions: 1.17, 1.18, 1.19, 1.20, 1.21*, 26.1
*Folia 1.19.4+ support (version 1.1.3 add)
Features
- Easy-to-use language pack management for Bukkit plugins
- Language packs for different Minecraft versions can be downloaded from [GitHub](https://github.com/0obriano0/MCLang/tree/main/Local%20Language%20Pack)
- Automatically downloads language packs from the official Minecraft resources if not present
- Hot-reload language files without server restart
- API for developers to integrate custom messages
Web API & Frontend Portal (version 1.2.0 add)
MCLang includes a built-in modern Web API and an interactive frontend portal, making it easy to query translations programmatically or test them directly via your browser.
Enable and configure in plugins/MCLang/config.yml:
Code (YAML):
web:
enabled : true # Master switch
ssl:
enabled : false
keystorePath : "keystore.jks"
keystorePassword : "password"
api:
host : 127.0.0.1
port : 8765
cors : true
maxEntriesPerRequest : 300
requireKey : false # Set to true to require a Bearer token
key : "YOUR_SECRET_KEY" # The token clients must provide
frontend:
enabled : true
host : 127.0.0.1
port : 8766
cors : true
staticDir : web # Automatically extracted on startup
enabled : true # Master switch
ssl:
enabled : false
keystorePath : "keystore.jks"
keystorePassword : "password"
api:
host : 127.0.0.1
port : 8765
cors : true
maxEntriesPerRequest : 300
requireKey : false # Set to true to require a Bearer token
key : "YOUR_SECRET_KEY" # The token clients must provide
frontend:
enabled : true
host : 127.0.0.1
port : 8766
cors : true
staticDir : web # Automatically extracted on startup
- Interactive Web Portal: http://127.0.0.1:8766/ (or https:// if SSL is enabled)
- Features a modern, multi-language (i18n) test playground.
- Dynamically extracts HTML/CSS/JS/JSON frontend files to plugins/MCLang/web/ on server start.
- Backend API Base URL: http://127.0.0.1:8765
- (Access is denied with 401 Unauthorized if requireKey is enabled and no token is passed)
- GET /api/languages: Returns a list of all currently loaded language codes and their versions.
- GET /api/languages/{lang}: Get keys/values for a specific language.
- Supported query parameters: version, prefix, limit, offset.
- GET /api/translate: Query a single translation string.
- Usage: ?lang=zh_tw&key=item.minecraft.diamond_sword
- POST /api/translate: Query a single translation string via POST.
- Usage: send JSON payload {"lang":"zh_tw","key":"item.minecraft.diamond_sword"}
Gradle
Code (Text):
repositories {
mavenCentral()
maven { url 'https://repo1.maven.org/maven2/' }
}
dependencies {
compileOnly 'org.tsob:MCLang-API:1.1.3'
}
mavenCentral()
maven { url 'https://repo1.maven.org/maven2/' }
}
dependencies {
compileOnly 'org.tsob:MCLang-API:1.1.3'
}
Code (Text):
<repositories>
<repository>
<id>maven</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<dependency>
<groupId>org.tsob</groupId>
<artifactId>MCLang-API</artifactId>
<version>1.1.3</version>
<scope>provided</scope>
</dependency>
<repository>
<id>maven</id>
<url>https://repo1.maven.org/maven2/</url>
</repository>
</repositories>
<dependency>
<groupId>org.tsob</groupId>
<artifactId>MCLang-API</artifactId>
<version>1.1.3</version>
<scope>provided</scope>
</dependency>
Example
Code (Java):
import
org.tsob.MCLang.API.MCLang
;
import org.bukkit.Material ;
import org.bukkit.entity.EntityType ;
import org.bukkit.inventory.ItemStack ;
public class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable ( ) {
MCLang lang = new MCLang ( "en" ) ;
// Get translation for an ItemStack
ItemStack item = new ItemStack (Material. DIAMOND_SWORD ) ;
String itemTranslation = lang. getItemTranslate (item ) ;
// Directly read the translation from the language pack.
String translation = getString ( "item.minecraft.diamond_sword" ) ;
// Get translation for an item name
String itemTranslationByName = lang. getItemTranslate ( "DIAMOND_SWORD" ) ;
// Get translation for an EntityType
String entityTranslation = lang. getEntityTranslate (EntityType. CREEPER ) ;
// Get translation by entity instance (version 1.1.0 add)
Entity entity = ... ; // your Entity instance
String entityTranslationFromEntity = lang. getEntityTranslate (entity ) ;
// Get translation for an entity name
String entityTranslationByName = lang. getEntityTranslate ( "CREEPER" ) ;
// Get translation for an enchantment (version 1.0.8 add)
String enchantmentTranslationByName = lang. getEnchantmentTranslate (Enchantment. SILK_TOUCH ) ;
// Get translation for an enchantment name (version 1.0.8 add)
String enchantmentTranslationByName = lang. getEnchantmentTranslate ( "SILK_TOUCH" ) ;
}
import org.bukkit.Material ;
import org.bukkit.entity.EntityType ;
import org.bukkit.inventory.ItemStack ;
public class ExamplePlugin extends JavaPlugin {
@Override
public void onEnable ( ) {
MCLang lang = new MCLang ( "en" ) ;
// Get translation for an ItemStack
ItemStack item = new ItemStack (Material. DIAMOND_SWORD ) ;
String itemTranslation = lang. getItemTranslate (item ) ;
// Directly read the translation from the language pack.
String translation = getString ( "item.minecraft.diamond_sword" ) ;
// Get translation for an item name
String itemTranslationByName = lang. getItemTranslate ( "DIAMOND_SWORD" ) ;
// Get translation for an EntityType
String entityTranslation = lang. getEntityTranslate (EntityType. CREEPER ) ;
// Get translation by entity instance (version 1.1.0 add)
Entity entity = ... ; // your Entity instance
String entityTranslationFromEntity = lang. getEntityTranslate (entity ) ;
// Get translation for an entity name
String entityTranslationByName = lang. getEntityTranslate ( "CREEPER" ) ;
// Get translation for an enchantment (version 1.0.8 add)
String enchantmentTranslationByName = lang. getEnchantmentTranslate (Enchantment. SILK_TOUCH ) ;
// Get translation for an enchantment name (version 1.0.8 add)
String enchantmentTranslationByName = lang. getEnchantmentTranslate ( "SILK_TOUCH" ) ;
}
TODO
- Improve API documentation
- Add more usage examples
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft versions listed: 1.17, 1.18, 1.19
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
MCLang [1.17x - 1.21x, 26.1][API] is a free Minecraft Java mod. Compatible with Minecraft 1.17, 1.18, 1.19, 1.20 and newer. Downloaded 226 times (via Spigot). Download it and open it directly in the game.