Package-level declarations

Text builder for building literal text objects

Types

Link copied to clipboard
class LiteralTextBuilder(baseText: Component?, inheritStyle: Boolean)

Properties

Link copied to clipboard
val String.literal: MutableComponent

Converts this string to a LiteralText instance.

Functions

Link copied to clipboard
fun MinecraftServer.broadcastText(text: Component)

Sends the given Component to each player on the server.

inline fun MinecraftServer.broadcastText(baseText: String? = null, builder: LiteralTextBuilder.() -> Unit = { })

Opens a LiteralTextBuilder and sends the resulting Component to each player on the server.

Link copied to clipboard
inline fun String.literalLines(width: Int = 40, cutLongWords: Boolean = true, lineBuilder: (line: String) -> Component = { it.literal }): List<Component>

Returns a list of Component elements which all do not exceed the given width.

Link copied to clipboard
inline fun literalText(baseText: String? = null, builder: LiteralTextBuilder.() -> Unit = { }): MutableComponent
Link copied to clipboard
fun CommandSource.sendText(text: Component)

Sends the given Component to the player.

fun MinecraftServer.sendText(text: Component)

inline fun CommandSource.sendText(baseText: String? = null, builder: LiteralTextBuilder.() -> Unit = { })

Opens a LiteralTextBuilder and sends the resulting MutableComponent to the player.

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

Returns a pretty printed JSON string of this Component in its serialized form.