
TextAPI
TextAPI is a Kotlin-native Spigot text engine with a MiniMessage-like syntax, built-in placeholders, gradients, rainbow, 16 pride presets, click/hover/insert events, and a custom TPS ticker. All fully extensible at runtime via a clean handler-based API.
Links
Tags
Creators
Details
0.1.0
Compatibility
Changes
[0.1.0] - Initial Release
text
Changelog
[0.1.0] - Initial Release
Added
- Core single-pass tokenizer (
TextParser) - Token types:
Text,OpenTag,CloseTag,Placeholder - Stack-based style renderer (
TextRenderer) - Named color tags:
<black>,<dark_blue>,<dark_green>,<dark_aqua>,<dark_red>,<dark_purple>,<gold>,<gray>,<dark_gray>,<blue>,<green>,<aqua>,<red>,<light_purple>,<yellow>,<white> - Hex color tags:
<#rrggbb>/</#rrggbb> - Color alias tags:
<color:#hex>,<colour:#hex>,<c:#hex> - Decoration tags:
<bold>,<italic>,<underlined>,<strikethrough>,<obfuscated>and all aliases (<b>,<i>,<em>,<u>,<underline>,<st>,<obf>,<magic>) - Decoration disable tags:
<!bold>,<!italic>, etc. <reset>tag to clear the entire style stack<newline>/<br>tags<gradient:#hex1:#hex2>with per-character color interpolation- Multi-stop gradient support (
<gradient:#hex1:#hex2:#hex3>) <rainbow>with HSV expansion<rainbow:phase>phase offset support- 14 built-in pride gradient tags:
<pride>,<trans>,<bi>,<lesbian>,<nonbinary>,<pan>,<ace>,<aro>,<genderfluid>,<agender>,<intersex>,<polyam>,<demi>,<genderqueer> - Click events:
<click:run_command:>,<click:suggest_command:>,<click:open_url:>,<click:copy_to_clipboard:>,<click:change_page:> - Hover events:
<hover:show_text:>with full inner tag parsing - Insertion events:
<insert:> - Escape character support:
\<passes through literally - Unknown tag passthrough: unrecognized tags render as raw text
- Unclosed tag tolerance: style applies to end of string
- Empty bracket passthrough:
<>renders literally {placeholder}syntax with{}delimitersTextStyledata class (color, bold, italic, underlined, strikethrough, obfuscated, clickEvent, hoverEvent, insertion)TextContextfor per-render placeholder resolution with override mapTextobject as the internal entry point (parse,components,send,broadcast,tokens)TextAPIpublic-facing API object (parse,components,send,tokens)TextServiceinterfaceTextServiceImpldelegating toTextTextTokensealed interfaceTextParserinternal classTextRendererinternal classTextTaginternal object (named colors, decoration aliases, pride gradients, normalize utility)TextPlaceholdersregistry with built-in player, server, time and misc placeholders- Built-in placeholders:
{player},{player_name},{player_uuid},{player_display},{player_world},{player_x},{player_y},{player_z},{player_ping},{player_gamemode},{player_health},{player_food},{player_level},{player_exp},{player_ip},{player_locale},{player_online},{server_name},{server_version},{server_motd},{server_online},{server_max},{time},{date},{newline},{prefix} registerPlaceholder/unregisterPlaceholderAPI/textapicommand with subcommands:parse,components,tokens,placeholders,register,unregister,examples- Tab completion for all subcommands
plugin.ymlwithapi-version: 1.21config.ymlwithcommand.enabledtogglecom.nolly.mc.textapi.commandpermission (default: op)- Legacy string output (
§-based) for console and non-player senders - Component array output for player senders via
spigot().sendMessage() - Broadcast utility (
Text.broadcast) - Nested tag support with correct stack unwinding on close
- Collecting frame system for gradient/rainbow/pride multi-character expansion
- Per-character gradient interpolation with multi-stop linear blending
- Legacy color RGB map for accurate gradient blending on named colors
- HSV-to-hex conversion for rainbow rendering
TextAPIPluginmain class extendingJavaPlugin- Maven build with Kotlin plugin and shade for stdlib bundling
- GitHub Packages deployment configuration
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:NvPsOCVp:6aEXPIzz"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:NvPsOCVp:6aEXPIzz"
}
