HoverTextBuilder

A builder for creating custom hoverable text components in Minecraft.

This class allows for creating text components with customizable hover text, click events, color, and formatting for use in Minecraft chat. It supports a variety of click actions (run command, suggest command, open URL, etc.) and also supports tooltips with multiple lines.

Parameters

text

The initial text to display in the message.

Constructors

Link copied to clipboard
constructor(text: String)

Functions

Link copied to clipboard

Appends additional text to the current text component.

Link copied to clipboard

Appends a formatted text component with additional hover text and click events.

Link copied to clipboard

Makes the text bold.

Link copied to clipboard
fun build(): TextComponent

Builds the final TextComponent with the specified properties.

Link copied to clipboard
fun color(color: ChatColor): HoverTextBuilder

Sets the color of the text.

fun color(r: Int, g: Int, b: Int): HoverTextBuilder

Sets the color of the text using RGB values.

Link copied to clipboard

Sets a click event that copies text to the clipboard when the text is clicked.

Link copied to clipboard

Sets the text that will be inserted when the text is clicked.

Link copied to clipboard

Makes the text italic.

Link copied to clipboard

Sets a click event that runs a command when the text is clicked.

Link copied to clipboard

Sets a click event that opens a URL when the text is clicked.

Link copied to clipboard

Resets the text to its default formatting.

Link copied to clipboard

Strikes through the text.

Link copied to clipboard

Sets a click event that suggests a command when the text is clicked.

Link copied to clipboard
fun tooltip(vararg lines: String): HoverTextBuilder

Adds a tooltip that appears when hovering over the text.

Link copied to clipboard

Underlines the text.