-
Notifications
You must be signed in to change notification settings - Fork 1
Legacy Format Support
Leo edited this page Dec 1, 2023
·
4 revisions
Messages can be read from and formed into different formats.
The default format using the Adventure MiniMessage.
a="<red>Hello world!</red>" # <-- because MiniMessage is default format this will be parsed as MiniMessage
a="!!minimessage: <red>Hello world!</red>"
String miniMessage = MY_MESSAGE.toString(MessageFormat.MINI_MESSAGE);
The JSON like format that is being used by Minecraft internally
a="!!nbt: {"text":"Hello world!","color":"red"}"
String nbt = MY_MESSAGE.toString(MessageFormat.NBT);
The original ingame formatter to make colored values. Does not support hover texts or clickable texts.
HexColors follow the pattern §x§r§r§g§g§b§b
a="!!paragraph: §cHello world!"
String legacyParagraph = MY_MESSAGE.toString(MessageFormat.LEGACY_PARAGRAPH);
Similar to the § formatter, but with the ampersand symbol instead. HexColors follow the patterh &#rrggbb
a="!!ampersand: &cHello world!"
String legacyAmpersand = MY_MESSAGE.toString(MessageFormat.LEGACY_AMPERSAND);
Simply turns everything into unformatted text.
# no reason, since MiniMessage would produce the same result.
a="!!plain: Hello world!"
# more likely example, where you don't want a tag to be parsed and display it as is:
a="!!plain: <msg:example>"
# it will produce the string "<msg:example>" and not a resolved message
String plain = MY_MESSAGE.toString(MessageFormat.PLAIN);