Package-level declarations

Types

Link copied to clipboard
sealed interface StyledElement

Represents a renderable element of a Component with an associated Style.

Functions

Link copied to clipboard
fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.append(fontChar: FontChar): B

Appends the fontChar's component to this component.

Link copied to clipboard
fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.appendCentered(component: Component, lang: String = "en_us"): B

Moves the cursor by half the width of the component to the left, then appends the component.

Link copied to clipboard
fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.color(color: Color): B

Sets the color of this component to color.

Link copied to clipboard
fun Component.elements(lang: String = "en_us"): Sequence<StyledElement>

Flattens this Component into a sequence of StyledElements using the specified lang for translations.

fun Component.elements(translate: (key: String) -> String?, outerStyle: Style = Style.empty()): Sequence<StyledElement>

Flattens this Component into a sequence of StyledElements using the specified translate function for translations. An optional outerStyle can be provided to be merged with each element's style.

Link copied to clipboard
fun Component.font(font: String): Component

fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.font(font: String): B

Sets the font of this component to font.

Link copied to clipboard
fun Component.fontName(): String?
Link copied to clipboard
fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.move(distance: Number): B

Moves the cursor by distance gui-scale-affected pixels.

Link copied to clipboard
fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.moveTo(afterStart: Number, lang: String = "en_us"): B

Moves the cursor to afterStart pixels after the beginning of the text, using lang to localize all potential translatable components.

Link copied to clipboard
fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.moveToCenter(lang: String = "en_us"): B

Moves the cursor to the center of the text, using lang to localize all potential translatable components.

Link copied to clipboard
fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.moveToStart(lang: String = "en_us"): B

Moves the cursor to the beginning of the text, using lang to localize all potential translatable components.

Link copied to clipboard
fun Array<out BaseComponent>.toAdventureComponent(): Component
fun String.toAdventureComponent(): Component
fun Component.toAdventureComponent(): Component
Link copied to clipboard
fun String.toAdventureComponentOr(createComponent: () -> Component): Component
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Component.toJson(): String
fun Component.toJson(): String
Link copied to clipboard
fun Component.toNBT(): StringTag
Link copied to clipboard
fun Component.toNMSComponent(): Component
Link copied to clipboard
fun Style.toNmsStyle(): Style
Link copied to clipboard
fun Component.toPlainText(locale: String = "en_us"): String
fun Component.toPlainText(player: Player): String
Link copied to clipboard
fun Component.withoutPreFormatting(): Component
fun Component.withoutPreFormatting(): Component