ClickableText

class ClickableText(builder: ComponentBuilder<*, *>) : Text, Stylable, Clickable

A text part of a ClickableMessage.

If a formatting option or action is not specified, the value of the containing message is applied.

Parameters

builder

The display text of the component.

Constructors

Link copied to clipboard
constructor(builder: ComponentBuilder<*, *>)

Creates a message component with the given text.

constructor(component: Component)
constructor(text: String)

Functions

Link copied to clipboard
open override fun bold(bold: Boolean)

Sets the font to bold.

Link copied to clipboard
open override fun color(color: TextColor)

Sets the color for the component.

Link copied to clipboard
open override fun copyToClipboard(text: String)

Copies the given text to the users clipboard when they click on the message.

Link copied to clipboard
open override fun hoverEvent(eventSource: HoverEventSource<*>)

Sets the source for the content when hovering over the message. Can be many things, e.g., a text component, item, entity, etc.

Link copied to clipboard
open override fun hoverMessage(init: Message.() -> Unit)

Sets the hover message displayed when the user hovers the mouse over the text.

open override fun hoverMessage(message: String, init: Text.() -> Unit)

Sets the text displayed as hover-message when the user hovers the mouse over the text.

Link copied to clipboard
open override fun insert(text: String)

Sets the text appended to the client's text input when the user shift + left-clicks a message.

Link copied to clipboard
open override fun italic(italic: Boolean)

Sets the font to italic.

Link copied to clipboard
open override fun obfuscated(obfuscated: Boolean)

Obfuscates text by switching each letter between multiple characters. Will result in non-readable text.

Link copied to clipboard
open override fun openUrl(url: String)

Opens the "open URL" dialog when the user clicks on the message.

Link copied to clipboard
open override fun runCommand(command: String)

Runs a command when left-clicking on the text as the user who clicked the message.

Link copied to clipboard
open override fun strikeThrough(strikeThrough: Boolean)

Strikes the text through.

Link copied to clipboard
open override fun suggestCommand(command: String)

Inserts a command into the client's chat bar of the user who clicked the message.

Link copied to clipboard
open override fun underlined(underlined: Boolean)

Underlines the text.