Build a new text component from the given parts.
Special types:
-
null: End the current component and start a new one
-
TextFormatting: Add a new formatting to the current style
-
Color: Add a new rgb color to the current style
-
ClickEvent: Add a new click event to the current style
-
HoverEvent: Add a new hover event to the current style
-
Style: Set the current style
All other objects will be converted to a string and added to the current component.
The order of the parts is important:
First you have to add the text and then the formattings and events.
Example:
build("Hello", Formatting.RED, " World", Formatting.GREEN)
This results in a component with "Hello" in red and " World" in green.