Tags
Creators
Details
2.0.0
Compatibility
Changes
The Element API
Major rewrite of the interactive message system. Element replaces the old chat components with a single immutable type that is parsed once and rendered per player, plus a faster color pipeline. Classic PrismaticAPI.colorize(...) usage is untouched.
Added
- Added
Element, one message type for plain text and interactive text. Parse it once, keep the instance, and render it for every player. - Added placeholder support inside elements:
{name}and%name%tokens are kept as data and resolved at render time, so a gradient now spans the resolved value instead of the length of the token. - Added a render cache. Each segment caches its colorized text for the two color profiles (hex and legacy), so an element sent to a hundred players pays the color pipeline twice.
- Added
AdventureElementas a separate class, so a server without Adventure never loads a Kyori class by touching an element. - Added
PrismaticAPI.supportsHexColors(player)to check whether a player's client can actually receive RGB colors. - Added
PrismaticAPI.forgetPlayer(...)andPrismaticAPI.clearPlayerCache()to drop cached player color capabilities. - Added markup helpers:
Element.isMarkup(raw),Element.stripMarkup(raw),element.toMarkup(), andautoLinkUrl()on the builder.
Changed
- Replaced the
me.croabeast.prismatic.chatpackage withme.croabeast.prismatic.element.ChatComponentandMultiComponentare gone;Elementcovers both. - Elements are now immutable. Changes go through
element.toBuilder(), so a shared instance can never be modified by another consumer. - Renamed three click constants:
EXECUTEtoRUN_COMMAND,SUGGESTtoSUGGEST_COMMAND,CLIPBOARDtoCOPY_TO_CLIPBOARD. The string aliases (run,suggest,copy, ...) are unchanged. - A player's hex support is now resolved once per session instead of once per formatted line.
- Text with no color markers now skips the color passes entirely.
- An empty message now renders to an empty array instead of a padded blank component.
- Updated the Gradle wrapper to 9.6.1.
Fixed
- Fixed gradients bleeding one color too far when the text started with a hex-prefixed color.
- Fixed placeholders not resolving inside click and hover values of an element.
Notes / Recommendations
- This is a breaking release. Any plugin using the old chat components must be updated before it will compile against 2.0.0.
- The README includes a full migration table from 1.5.x to 2.0.0, method by method.
- Call
PrismaticAPI.forgetPlayer(...)from yourPlayerQuitEventhandler so cached entries do not survive the session. - Plugins that only use
PrismaticAPI.colorize(...)and the Adventure facade need no changes.
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:q0sNS9SL:feTQYc2z"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:q0sNS9SL:feTQYc2z"
}

