Package-level declarations

Types

Link copied to clipboard
annotation class ComponentDsl

DSL marker annotation for component builder scopes.

Link copied to clipboard

Represents different component serialization formats supported by Adventure API.

Link copied to clipboard
annotation class ExperimentalNbtComponent
Link copied to clipboard
annotation class StyleDsl

DSL marker annotation for style builder scopes.

Properties

Link copied to clipboard
val String.component: Component

Property accessor for converting this string into a Component.

Link copied to clipboard
val Component.text: String

Property accessor for converting this component into a string using LEGACY_AMPERSAND format.

Functions

Link copied to clipboard
infix fun Component.append(content: String): @NotNull Component

Appends a text component with the given content to this component.

infix fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.append(content: String): @NotNull B

Appends a text component with the given content to this component builder.

Link copied to clipboard
fun Style.aqua(): Style
fun Style.Builder.aqua(): Style.Builder

Sets the text color to aqua.

Link copied to clipboard
fun Style.black(): Style
fun Style.Builder.black(): Style.Builder

Sets the text color to black.

Link copied to clipboard
fun Style.blue(): Style
fun Style.Builder.blue(): Style.Builder

Sets the text color to blue.

Link copied to clipboard

Sets the bold decoration of the last component added to this ComponentBuilder.

fun Style.bold(): Style

Applies the bold text decoration to this style.

fun Style.Builder.bold(): Style.Builder

Applies the bold text decoration to this style builder.

Link copied to clipboard
fun component(consumer: ComponentBuilder.() -> Unit): Component

Creates a text component using a DSL builder pattern.

fun component(joiner: (ComponentBuilder) -> Component = ComponentBuilder::join, consumer: ComponentBuilder.() -> Unit): Component

Creates a text component using a DSL builder pattern with a custom joiner function.

@JvmName(name = "componentJoinConfiguration")
fun component(joiner: JoinConfiguration.Builder.() -> Unit, consumer: ComponentBuilder.() -> Unit): Component
Link copied to clipboard
fun String.component(): Component

Converts this string into a Component by auto-detecting the format type.

fun String.component(style: Style): Component
Link copied to clipboard
fun Style.darkAqua(): Style
fun Style.Builder.darkAqua(): Style.Builder

Sets the text color to dark aqua.

Link copied to clipboard
fun Style.darkBlue(): Style
fun Style.Builder.darkBlue(): Style.Builder

Sets the text color to dark blue.

Link copied to clipboard
fun Style.darkGray(): Style
fun Style.Builder.darkGray(): Style.Builder

Sets the text color to dark gray.

Link copied to clipboard
fun Style.darkGreen(): Style
fun Style.Builder.darkGreen(): Style.Builder

Sets the text color to dark green.

Link copied to clipboard
fun Style.darkPurple(): Style
fun Style.Builder.darkPurple(): Style.Builder

Sets the text color to dark purple.

Link copied to clipboard
fun Style.darkRed(): Style
fun Style.Builder.darkRed(): Style.Builder

Sets the text color to dark red.

Link copied to clipboard
Link copied to clipboard
fun Style.font(nsPath: String): Style
fun Style.Builder.font(nsPath: String): Style.Builder

Sets the font using a namespaced path string (e.g., "namespace:path").

fun Style.font(ns: String, path: String): Style
fun Style.Builder.font(ns: String, path: String): Style.Builder

Sets the font using the specified namespace and path.

Link copied to clipboard
fun Style.gold(): Style
fun Style.Builder.gold(): Style.Builder

Sets the text color to gold.

Link copied to clipboard
fun Style.gray(): Style
fun Style.Builder.gray(): Style.Builder

Sets the text color to gray.

Link copied to clipboard
fun Style.green(): Style
fun Style.Builder.green(): Style.Builder

Sets the text color to green.

Link copied to clipboard

Sets the italic decoration of the last component added to this ComponentBuilder.

fun Style.italic(): Style

Applies the italic text decoration to this style.

fun Style.Builder.italic(): Style.Builder

Applies the italic text decoration to this style builder.

Link copied to clipboard
fun Style.lightPurple(): Style
fun Style.Builder.lightPurple(): Style.Builder

Sets the text color to light purple.

Link copied to clipboard

Sets the obfuscated decoration of the last component added to this ComponentBuilder.

fun Style.obfuscated(): Style

Applies the obfuscated text decoration to this style.

fun Style.Builder.obfuscated(): Style.Builder

Applies the obfuscated text decoration to this style builder.

Link copied to clipboard
operator fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.plus(content: String): @NotNull B

Operator function to append a string to this component builder using the + operator.

operator fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.plus(component: Component): @NotNull B

Operator function to append a component to this component builder using the + operator.

Link copied to clipboard
operator fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.plusAssign(content: String)

Operator function to append a string to this component builder using the += operator.

operator fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.plusAssign(component: Component)

Operator function to append a component to this component builder using the += operator.

Link copied to clipboard

Sets the text color to light purple.

Link copied to clipboard
fun Style.red(): Style
fun Style.Builder.red(): Style.Builder

Sets the text color to red.

Link copied to clipboard
fun Style.reset(): Style

Removes all text decorations from this style.

fun Style.Builder.reset(): Style.Builder

Removes all text decorations from this style builder.

Link copied to clipboard
fun Collection<Audience>.send(consumer: ComponentBuilder.() -> Unit)
fun Collection<Audience>.send(component: Component)
fun Audience.send(consumer: ComponentBuilder.() -> Unit)
fun Audience.send(component: Component)
inline fun Collection<Audience>.send(noinline joiner: (ComponentBuilder) -> Component = ComponentBuilder::join, noinline consumer: ComponentBuilder.() -> Unit)
inline fun Audience.send(noinline joiner: (ComponentBuilder) -> Component = ComponentBuilder::join, noinline consumer: ComponentBuilder.() -> Unit)
Link copied to clipboard

Sets the strikethrough decoration of the last component added to this ComponentBuilder.

fun Style.strikethrough(): Style

Applies the strikethrough text decoration to this style.

fun Style.Builder.strikethrough(): Style.Builder

Applies the strikethrough text decoration to this style builder.

Link copied to clipboard
inline fun style(consumer: Styler.() -> Unit): Style

Creates a text style using a DSL builder pattern.

Link copied to clipboard
fun Component.text(out: ComponentType = ComponentType.LEGACY_AMPERSAND): String

Serializes this component into a string using the specified format.

Link copied to clipboard

Sets the underline decoration of the last component added to this ComponentBuilder.

Link copied to clipboard
fun Style.underlined(): Style

Applies the underlined text decoration to this style.

fun Style.Builder.underlined(): Style.Builder

Applies the underlined text decoration to this style builder.

Link copied to clipboard
fun Style.white(): Style
fun Style.Builder.white(): Style.Builder

Sets the text color to white.

Link copied to clipboard
infix fun Style.withClickCommand(event: String): @NotNull Style

Sets the click event of this style to run a command from a string.

Link copied to clipboard
infix fun Style.withClickEvent(event: ClickEvent): @NotNull Style

Sets the click event of this style.

Link copied to clipboard

Sets the color of the last component added to this ComponentBuilder using an integer RGB value.

infix fun ComponentBuilder.withColor(color: TextColor): ComponentBuilder

Sets the color of the last component added to this ComponentBuilder.

infix fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.withColor(color: TextColor): @NotNull B

Sets the color of this component builder.

infix fun Style.withColor(color: Int): @NotNull Style

Sets the color of this style using an integer RGB value.

infix fun Style.withColor(color: TextColor): @NotNull Style

Sets the color of this style.

Link copied to clipboard
infix fun Style.withDecoration(decoration: Collection<TextDecoration>): @NotNull Style

Adds multiple text decorations to this style.

infix fun Style.withDecoration(decoration: TextDecoration): @NotNull Style

Adds a text decoration to this style.

Link copied to clipboard

Sets the font of the last component added to this ComponentBuilder using a font key string.

Sets the font of the last component added to this ComponentBuilder.

infix fun Style.withFont(font: Key): @NotNull Style

Sets the font of this style.

Link copied to clipboard
infix fun Style.withHoverEvent(event: Component): @NotNull Style

Sets the hover event of this style using a component.

Link copied to clipboard
infix fun Style.withInsertion(insertion: String): @NotNull Style

Sets the insertion text of this style.

Link copied to clipboard
infix fun Style.withOpenFile(file: String): @NotNull Style

Sets the click event of this style to open a file.

Link copied to clipboard
infix fun Style.withOpenURL(url: String): @NotNull Style

Sets the click event of this style to open a URL.

Link copied to clipboard
infix inline fun ComponentBuilder.withStyle(crossinline consumer: Styler.() -> Unit): ComponentBuilder

Applies a style to the last component added to this ComponentBuilder using a DSL builder pattern.

infix fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.withStyle(consumer: Style.Builder.() -> Unit): @NotNull B

Applies a style to this component builder using a builder consumer.

infix fun <C : BuildableComponent<C, B>, B : ComponentBuilder<C, B>> ComponentBuilder<C, B>.withStyle(style: Style): @NotNull B

Applies a style to this component builder.

Link copied to clipboard
infix fun Style.withSuggestCommand(command: String): @NotNull Style

Sets the click event of this style to suggest a command.

Link copied to clipboard
fun Style.yellow(): Style
fun Style.Builder.yellow(): Style.Builder

Sets the text color to yellow.