An alternative input format for Adventure, building on top of the well known legacy formatting codes.
repositories {
mavenCentral()
}
dependencies {
implementation 'dev.vankka:enhancedlegacytext:1.0.0'
}
<dependency>
<groupId>dev.vankka</groupId>
<artifactId>enhancedlegacytext</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
Component component = EnhancedLegacyText.get().buildComponent("&c&lThis is red, [click:open_url:https://github.com]this is clickable, this %placeholder% got replaced")
.replace("%placeholder%", Component.text("<The placeholder replacement>").color(NamedTextColor.GREEN))
.build();
- The legacy codes
- Exception: Formatting codes remain enabled after color codes (Can be re-enabled via
EnhancedLegacyText.Builder#colorResets
)
- Exception: Formatting codes remain enabled after color codes (Can be re-enabled via
- Adventure's hex format, (
&#<hex>
/&#abc123
)
Surrounded by {
and }
, seperated by ,
Examples:
{&a,&2,&3}
{&a,�aa00,&3}
(mix & match permitted){7ff55,�aa00,�aaaa}
Events are surrounded by [
and ]
, and split at the first two :
, first part being either click
or hover
Valid types: open_url
, run_command
, suggest_command
, change_page
, copy_to_clipboard
Examples:
[click:open_url:https://github.com/Vankka/EnhancedLegacyText]
[click:run_command:say hello]
[click:suggest_command:/help]
[click:change_page:2]
[click:copy_to_clipboard:Secret]
Valid type: show_text
Examples:
[hover:show_text:Hello]
[hover:show_text:�aa00Hello]