printStyledText

fun printStyledText(key: String, data: String? = null, formatting: (MutableComponent) -> MutableComponent = ::regular, hover: HoverEvent? = HoverEvent.ShowText(translation("liquidbounce.tooltip.clickToCopy")), click: ClickEvent? = data?.let(ClickEvent::CopyToClipboard))

Sends a styled command result with copyable content

Parameters

key

Translation key (will be prefixed with command's translation base)

data

Optional data to be displayed and copied

formatting

Function to apply formatting to the text (default: regular)

hover

Optional hover event (defaults to "Click to copy" tooltip)

click

Optional click action type (defaults to ClickEvent.CopyToClipboard)