Package net.kyori.adventure.text
Interface TextComponent
- All Superinterfaces:
Buildable<TextComponent,,TextComponent.Builder> BuildableComponent<TextComponent,,TextComponent.Builder> Component,ComponentBuilderApplicable,ComponentLike,net.kyori.examination.Examinable,HoverEventSource<Component>,ScopedComponent<TextComponent>,StyleGetter,StyleSetter<Component>
- All Known Subinterfaces:
VirtualComponent
public interface TextComponent
extends BuildableComponent<TextComponent,TextComponent.Builder>, ScopedComponent<TextComponent>
A component that displays a string.
This component consists of:
- content
- string to be displayed
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA text component builder. -
Field Summary
Fields inherited from interface net.kyori.adventure.text.Component
EQUALS, EQUALS_IDENTITY, IS_NOT_EMPTY -
Method Summary
Modifier and TypeMethodDescription@NotNull Stringcontent()Gets the plain text content.@NotNull TextComponentSets the plain text content.default @NotNull Stream<? extends net.kyori.examination.ExaminableProperty>static @NotNull TextComponentofChildren(@NotNull ComponentLike @NotNull ... components) Deprecated.Methods inherited from interface net.kyori.adventure.text.BuildableComponent
toBuilderMethods inherited from interface net.kyori.adventure.text.Component
asHoverEvent, children, clickEvent, color, compact, componentBuilderApply, contains, contains, decoration, decorations, detectCycle, font, hasDecoration, hasStyling, hoverEvent, insertion, iterable, iterable, iterator, iterator, replaceFirstText, replaceFirstText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, shadowColor, spliterator, spliterator, styleMethods inherited from interface net.kyori.examination.Examinable
examinableName, examineMethods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEventMethods inherited from interface net.kyori.adventure.text.ScopedComponent
append, append, append, append, append, appendNewline, appendSpace, applyFallbackStyle, applyFallbackStyle, asComponent, children, clickEvent, color, colorIfAbsent, decorate, decoration, decoration, decorationIfAbsent, decorations, font, hoverEvent, insertion, mergeStyle, mergeStyle, mergeStyle, shadowColor, shadowColorIfAbsent, style, style, style, styleMethods inherited from interface net.kyori.adventure.text.format.StyleSetter
decorate, decorations
-
Method Details
-
ofChildren
@ScheduledForRemoval(inVersion="5.0.0") @Deprecated @NotNull static @NotNull TextComponent ofChildren(@NotNull @NotNull ComponentLike @NotNull ... components) Deprecated.for removal since 4.9.0, useComponent.textOfChildren(ComponentLike...)insteadCreates a component withcomponentsas the children.- Parameters:
components- the children- Returns:
- a text component
- Since:
- 4.0.0
-
content
Gets the plain text content.- Returns:
- the plain text content
- Since:
- 4.0.0
-
content
Sets the plain text content.- Parameters:
content- the plain text content- Returns:
- a copy of this component
- Since:
- 4.0.0
-
examinableProperties
@NotNull default @NotNull Stream<? extends net.kyori.examination.ExaminableProperty> examinableProperties()- Specified by:
examinablePropertiesin interfaceComponent- Specified by:
examinablePropertiesin interfacenet.kyori.examination.Examinable
-
Component.textOfChildren(ComponentLike...)instead