A powerful, centralized core utility API for Spigot/Paper plugins, specializing in native multi-language (i18n) support and modern text formatting.
- π¨ Modern Formatting: Native support for MiniMessage (RGB, Gradients, Click Events).
- π Smart i18n: Multi-language support with automatic player locale detection and fallback systems.
- π PlaceholderAPI Integration: Seamlessly converts
%placeholders%into MiniMessage-compatible tags. - β‘ Zero Boilerplate: Optimized utility classes to dispatch formatted components in a single line.
- βοΈ Config Management: Includes a robust YAML configuration updater and custom config handlers.
Add the Nukecraft5419 Repository and the dependency to your build.gradle.kts:
repositories {
mavenCentral()
maven("https://repo.nukecraft5419.com/")
}
dependencies {
// Replace '1.0.0' with the latest release version
implementation("dev.nukecraft5419:nukelexicon:1.0.0")
}Since you are using implementation, it is highly recommended to use the Shadow Gradle Plugin to shade and relocate NukeLexicon inside your plugin's JAR. This prevents version conflicts if multiple plugins on the same server use different versions of this API. If you prefer server owners to install NukeLexicon as a standalone plugin, use compileOnly instead.
Automatically detects your plugin's name, prefix, and uses en_US as the default language:
@Override
public void onEnable() {
// Essential for Adventure Audiences and internal managers
NukeLexicon.init(this);
}Manually define the fallback language and the default prefix:
@Override
public void onEnable() {
// Parameters: Plugin instance, Fallback language, Default Prefix
NukeLexicon.init(this, "en_GB", "<dark_gray>[<gold>MyPlugin</gold>]");
}To prevent memory leaks, remember to close the API in your onDisable:
@Override
public void onDisable() {
NukeLexicon.close();
}Use SendUtils to deliver MiniMessage-formatted strings to any CommandSender:
// Supports MiniMessage tags, hex colors, and PAPI placeholders
SendUtils.sendMessage(player, "<gradient:aqua:blue>Welcome back, %player_name%!</gradient>");
// Log formatted messages to console
SendUtils.log("<red>[Alert]</red> System core initialized.");Retrieve and send messages based on the player's client language automatically:
// Fetches the path 'messages.welcome' from the player's locale file
SendUtils.sendTranslation(player, "messages.welcome");NukeLexicon uses bStats to track anonymous usage data. View global statistics here:
Contributions are welcome! If you have suggestions or find bugs, feel free to open an issue or a pull request. Let's make localized plugins easier for everyone!
This project is licensed under the MIT License.