Description
"kukso-hy-lib" is a core library for the Kukso Hytale Mods ecosystem. It provides essential utilities and modules that streamline Hytale mod development. Instead of reinventing the wheel for every mod, this library offers battle-tested solutions for common modding needs.
Features
Localization Module
Multi-language support based on the player's client language setting.
import com.kukso.hy.lib.locale.LocaleMan;
// Basic usage - automatically uses the player's language
Message msg = LocaleMan.get(playerRef, "messages.welcome");
player.sendMessage(msg);
// With placeholders
Message msg = LocaleMan.get(playerRef, "messages.welcome",
Map.of("player", player.getUsername()));
// Raw string for specific locale
String text = LocaleMan.getRaw("en\_US", "messages.welcome");
// Check what locales are loaded
Set loaded = LocaleMan.getLoadedLocales();
Language file example (locales/en_US.json):
{
"prefix": "&e[MyPlugin]&r",
"messages": {
"welcome": "&aWelcome, &e{player}&a!",
"goodbye": "&7Goodbye, &e{player}&7!"
},
"errors": {
"no_permission": "&cYou don't have permission to do that.",
"not_enough_coins": "&cYou need {required} coins. You have {current}."
}
}
Features:
- JSON-based language files (no external dependencies)
- Automatic placeholder resolution with
{placeholder}syntax - Player language detection from client settings
- Fallback chain: Player locale → Default locale (en_US) → Key name
- Thread-safe with concurrent access support
- Hot-reload via
/kuksolib reload - Color code support in translations (integrates with ColorMan)
Note: Hytale only supports English in Early Access.
Chat Colorization Module
Translate Minecraft-style color codes to Hytale's Message format.
import com.kukso.hy.lib.util.ColorMan;
// Basic color codes - returns Hytale Message object
Message msg = ColorMan.translate("&aGreen &bAqua &cRed");
// Multiple colors in one message
Message msg = ColorMan.translate("&4Hel&clo &bWo&1rld!");
// Result: "Hel" dark red, "lo " red, "Wo" aqua, "rld!" dark blue
// Hex color support
Message msg = ColorMan.translate("&#FF5733This is orange!");
// Formatting codes
Message msg = ColorMan.translate("&l&4Bold Red &r&oItalic White");
// Combined with localization
Message msg = LocaleMan.get(player, "messages.welcome"); // Already colored!
player.sendMessage(msg);
Supported Codes:
- Legacy colors:
&0-9,&a-f(standard 16 Minecraft colors) - Hex colors:
&#RRGGBB(e.g.,&#FF5733) - Bold:
&l - Italic:
&o - Reset:
&r(resets color and formatting)
Features:
- Full legacy color code support
- Hex color support for custom colors
- Multiple colors in a single message
- Format codes (bold, italic)
- Seamless integration with LocaleMan
- Returns native Hytale Message objects
Note: Underline (&n), strikethrough (&m), and obfuscated (&k) are not supported by Hytale's Message API.



