McTranslatableText

class McTranslatableText(val key: String, val args: Array<Any>) : McTextComponent

Represents a Minecraft translatable text component.

This class represents a text component that can be translated based on a localization key and optional arguments.

Parameters

key

The translation key used to look up the localized text.

args

An array of arguments to replace placeholders in the localized text.

Constructors

Link copied to clipboard
constructor(key: String, args: Array<Any>)

Properties

Link copied to clipboard
val args: Array<Any>
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
val key: String
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
open override fun toString(): String
Link copied to clipboard

Applies one or more styles to this text component.

Applies a style to this text component.