Class ChatMessageBuilder
java.lang.Object
me.internalizable.numdrassl.api.chat.ChatMessageBuilder
Builder for creating formatted chat messages.
Provides a fluent API for constructing formatted messages with colors, bold, italic, underline, and other styling.
Example usage:
ChatMessageBuilder message = ChatMessageBuilder.create()
.green("[Success] ")
.white("Operation completed!");
player.sendMessage(message);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classCommon color constants in hex format. -
Method Summary
Modifier and TypeMethodDescriptionAppends aqua/cyan colored text.Appends black colored text.Appends blue colored text.Appends bold text with the specified hex color.build()Builds the formatted message as a single part containing all children.static ChatMessageBuildercreate()Creates a new builder instance.Appends dark aqua colored text.Appends dark blue colored text.Appends dark gray colored text.Appends dark green colored text.darkPurple(String text) Appends dark purple colored text.Appends dark red colored text.getParts()Gets all the message parts.Appends gold/orange colored text.Appends gray colored text.Appends green colored text.Appends italic text with the specified hex color.Appends purple/magenta colored text.Appends red colored text.strikethrough(String text, String hexColor) Appends strikethrough text with the specified hex color.Appends text with the specified hex color.Appends underlined text with the specified hex color.Appends white colored text.Appends yellow colored text.
-
Method Details
-
create
Creates a new builder instance.- Returns:
- a new ChatMessageBuilder
-
text
Appends text with the specified hex color.- Parameters:
text- the text to appendhexColor- the color in hex format (e.g., "#FF5555")- Returns:
- this builder
-
bold
Appends bold text with the specified hex color.- Parameters:
text- the text to appendhexColor- the color in hex format- Returns:
- this builder
-
italic
Appends italic text with the specified hex color.- Parameters:
text- the text to appendhexColor- the color in hex format- Returns:
- this builder
-
underline
Appends underlined text with the specified hex color.- Parameters:
text- the text to appendhexColor- the color in hex format- Returns:
- this builder
-
strikethrough
Appends strikethrough text with the specified hex color.- Parameters:
text- the text to appendhexColor- the color in hex format- Returns:
- this builder
-
red
Appends red colored text. -
darkRed
Appends dark red colored text. -
green
Appends green colored text. -
darkGreen
Appends dark green colored text. -
gold
Appends gold/orange colored text. -
yellow
Appends yellow colored text. -
aqua
Appends aqua/cyan colored text. -
darkAqua
Appends dark aqua colored text. -
blue
Appends blue colored text. -
darkBlue
Appends dark blue colored text. -
purple
Appends purple/magenta colored text. -
darkPurple
Appends dark purple colored text. -
white
Appends white colored text. -
gray
Appends gray colored text. -
darkGray
Appends dark gray colored text. -
black
Appends black colored text. -
getParts
Gets all the message parts.- Returns:
- an unmodifiable list of message parts
-
build
Builds the formatted message as a single part containing all children.- Returns:
- the built FormattedMessagePart
-