Skip to content
Henri Schubin edited this page Mar 27, 2025 · 5 revisions

The EnhancedLegacyText format

Version 2.0

Table of contents


Square Brackets format

Color

[color:<color name>] examples:

  • [color:red]
  • [color:aquamarine]

[color:<hex>] examples:

  • [color:00ff00]
  • [color:#00ff00]
  • [color:0f0]
  • [color:#0f0]

Or without the color: prefix, examples:

  • [red]
  • [aquamarine]
  • [00ff00]
  • [#00ff00]
  • [0f0]
  • [#0f0]

To reset the color use [color] example: [color:red]red[color] normal

Available colors

If you would like to specify which color namespace you would like to use, use the [color:<namespace>:<name>] format, examples:

  • [color:minecraft:red]
  • [color:css:aquamarine]
  • [color:hex:#0f0]

Gradients

Surrounded by { and }, seperated by ,

Examples:

  • {[red],[blue],[red]}
  • {[color:red],[color:blue],[color:red]}
  • {[red],[#00f00],[color:css:red]}

If legacy/adventure hex is enabled:

  • {&a,&2,&3}
  • {&a,&#00aa00,[red]} (mix & match permitted)
  • {&#55ff55,&#00aa00,&#00aaaa}

Decoration

Values: bold, underlined (or underline), italics (or italic), strikethrough, obfuscated

[<decoration name>:<true/on/false/off>] examples:

  • [bold:true]
  • [underline:on]
  • [italic:on]
  • [bold:off]
  • [underline:false]
  • [italic:off]

If no value is specified after a : the decoration will be removed, example: [bold:on]bold[bold] normal

Full examples:

  • [bold:on]bold[bold] normal
  • [bold:true]bold[bold] normal
  • [bold:on]bold[bold:off] normal
  • [bold:true]bold[bold:false] normal
  • [bold:true]bold[bold:off] normal

Click events

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]

To reset the click event use [click] example: [click:run_command:say hi]click to say hi[click] normal text

Hover events

Valid type: show_text

Examples:

  • [hover:show_text:Hello]
  • [hover:show_text:&#00aa00Hello]

To reset the hover event use [hover] example: [hover:show_text:Hello]hover me![hover] normal text

Insertion

Text to insert into chat when Shift Clicked

Examples:

  • [insert:Hello]

To reset the insertion use [insert] example: [insert:Hello]Shift Click for "hello"[insert] this does nothing

Adventure Hex color

&#hex example: &#00f00

Can be disabled via EnhancedLegacyText.Builder#adventureHex

Legacy formatting

The legacy codes

Normally when a color code is used formatting (bold, italics, etc.) is removed, this is configurable in EnhancedLegacyText and is disabled by default

  • Use EnhancedLegacyText.Builder#colorResets to return to the Vanilla behaviour of resetting after color changes

Reset also resets click and hover events.

Can be disabled via EnhancedLegacyText.Builder#legacy