TextComponent

class TextComponent

Constructors

Link copied to clipboard
fun TextComponent(text: String)

Creates a TextComponent from a string.

Link copied to clipboard
fun TextComponent(chatComponent: MCITextComponent)

Creates a TextComponent from an existing ITextComponent.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun actionBar()

Shows the component on the actionbar as a new Message

Link copied to clipboard
fun chat()

Shows the component in chat as a new Message

Link copied to clipboard
fun getClickAction(): String?
Link copied to clipboard
fun getClickValue(): String?
Link copied to clipboard
fun getHoverAction(): String?
Link copied to clipboard
fun getHoverValue(): String?
Link copied to clipboard
fun getText(): String
Link copied to clipboard
fun isFormatted(): Boolean
Link copied to clipboard
fun setClick(action: String, value: String): TextComponent

Sets the click action and value of the component. See TextComponent.setClickAction for possible click actions.

Link copied to clipboard
fun setClickAction(action: String): TextComponent

Sets the action to be performed when the component is clicked on. Possible actions include:

Link copied to clipboard
fun setClickValue(value: String): TextComponent

Sets the value to be used by the click action. See TextComponent.setClickAction for possible click actions.

Link copied to clipboard
fun setFormatted(formatted: Boolean): TextComponent

Sets if the component is to be formatted

Link copied to clipboard
fun setHover(action: String, value: String): TextComponent

Sets the hover action and value of the component. See TextComponent.setHoverAction for possible hover actions.

Link copied to clipboard
fun setHoverAction(action: String): TextComponent

Sets the action to be performed when the component is hovered over. Hover action is set to 'show_text' by default. Possible actions include:

Link copied to clipboard
fun setHoverValue(value: String): TextComponent

Sets the value to be used by the hover action. See TextComponent.setHoverAction for possible hover actions.

Link copied to clipboard
fun setText(text: String): TextComponent

Sets the components text string.

Link copied to clipboard
open override fun toString(): String

Properties

Link copied to clipboard
lateinit var chatComponentText: MCITextComponent

Sources

Link copied to clipboard