McTextComponent

abstract class McTextComponent

Represents a Minecraft text component.

This abstract class serves as the base for creating rich-text components used in Minecraft messages. It provides methods for adding styles, handling click and hover events, and composing text components.

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The click event associated with this text component, if any.

Link copied to clipboard

The hover event associated with this text component, if any.

Link copied to clipboard

List of sibling text components that are displayed alongside this component.

Link copied to clipboard

List of text styles applied to this component.

Functions

Link copied to clipboard
fun append(vararg components: McTextComponent): McTextComponent

Appends one or more text components to the list of siblings.

Appends a collection of text components to the list of siblings.

Link copied to clipboard

Sets the click event for this text component.

Link copied to clipboard

Sets the hover event for this text component.

Link copied to clipboard

Merges this text component with another text component, combining their styles, siblings, and events.

Link copied to clipboard

Applies one or more styles to this text component.

Applies a style to this text component.