DelegatedComponent

interface DelegatedComponent : Component, Supplier<Component>

A component that is delegated to another component.

The implementation should provide delegation with get. This method should never return null.

Inheritors

Properties

Link copied to clipboard
val EMPTY: FormattedText
Link copied to clipboard

Functions

Link copied to clipboard
fun FormattedText.asFormattedCharSequence(): FormattedCharSequence
Link copied to clipboard
open fun composite(parts: Array<FormattedText>): FormattedText
Link copied to clipboard
open fun contains(other: Component): Boolean
Link copied to clipboard
open fun copy(): MutableComponent
Link copied to clipboard
open fun empty(): MutableComponent
Link copied to clipboard
abstract fun get(): T
Link copied to clipboard
open fun getContents(): ComponentContents
Link copied to clipboard
open fun getSiblings(): List<Component>
Link copied to clipboard
open fun getString(): String
open fun getString(maxLength: Int): String
Link copied to clipboard
open fun getStyle(): Style
Link copied to clipboard
open fun getVisualOrderText(): FormattedCharSequence
Link copied to clipboard
open fun keybind(name: String): MutableComponent
Link copied to clipboard
open fun lazy(initializer: () -> out Component): DelegatedComponent
Creates a lazy delegated component based on kotlin.Lazy.
Link copied to clipboard
open fun literal(text: String): MutableComponent
Link copied to clipboard
fun Component.mapComponent(contentMapper: UnaryOperator<ComponentContents> = UnaryOperator.identity(), styleMapper: UnaryOperator<Style> = UnaryOperator.identity()): Component

Returns a new component with contentMapper applied to the contents and styleMapper applied to the style of every part, or the receiver itself if nothing changed.

Link copied to clipboard
open fun nbt(nbtPath: CompilableString<NbtPathArgument.NbtPath>, interpreting: Boolean, plain: Boolean, separator: Optional<Component>, dataSource: DataSource): MutableComponent
Link copied to clipboard
open fun nullToEmpty(text: @Nullable String): Component
Link copied to clipboard
open fun object(info: ObjectInfo): MutableComponent
Link copied to clipboard
open fun of(text: String): FormattedText
Link copied to clipboard
open fun plainCopy(): MutableComponent
Link copied to clipboard
fun Component.sanitizeForeignInput(): FormattedCharSequence

Sanitizes texts which are sent to the client.

Link copied to clipboard
fun Component.sanitizeForSerialization(): Component
Link copied to clipboard
open fun score(pattern: CompilableString<EntitySelector>, objective: String): MutableComponent
Link copied to clipboard
open fun selector(pattern: CompilableString<EntitySelector>, separator: Optional<Component>): MutableComponent
Link copied to clipboard
open fun toFlatList(): List<Component>
open fun toFlatList(style: Style): List<Component>
Link copied to clipboard
open fun translatable(key: String): MutableComponent
Link copied to clipboard
open fun translatableEscape(key: String, args: Array<Any>): MutableComponent
Link copied to clipboard
open fun translatableWithFallback(key: String, fallback: @Nullable String): MutableComponent
Link copied to clipboard
open fun translationArg(date: Date): Component
Link copied to clipboard
@Nullable
open fun tryCollapseToString(): @Nullable String
Link copied to clipboard
open fun <T> visit(acceptor: FormattedText.ContentConsumer<T>): Optional<T>
open fun <T> visit(acceptor: FormattedText.StyledContentConsumer<T>, style: Style): Optional<T>