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>
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 Classes Modifier and Type Interface Description static interface
TextComponent.Builder
A text component builder.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description @NonNull String
content()
Gets the plain text content.@NonNull TextComponent
content(@NonNull String content)
Sets the plain text content.static @NonNull TextComponent
ofChildren(@NonNull ComponentLike @NonNull ... components)
Creates a component withcomponents
as the children.-
Methods inherited from interface net.kyori.adventure.text.BuildableComponent
toBuilder
-
Methods inherited from interface net.kyori.adventure.text.Component
asComponent, asHoverEvent, children, clickEvent, color, componentBuilderApply, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, replaceFirstText, replaceFirstText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, replaceText, style, style
-
Methods inherited from interface net.kyori.examination.Examinable
examinableName, examinableProperties, examine
-
Methods inherited from interface net.kyori.adventure.text.event.HoverEventSource
asHoverEvent
-
Methods inherited from interface net.kyori.adventure.text.ScopedComponent
append, append, append, children, clickEvent, color, colorIfAbsent, decorate, decoration, decoration, hoverEvent, insertion, mergeStyle, mergeStyle, mergeStyle, style, style, style
-
-
-
-
Method Detail
-
ofChildren
static @NonNull TextComponent ofChildren(@NonNull ComponentLike @NonNull ... components)
Creates a component withcomponents
as the children.- Parameters:
components
- the children- Returns:
- a text component
- Since:
- 4.0.0
-
content
@NonNull String content()
Gets the plain text content.- Returns:
- the plain text content
- Since:
- 4.0.0
-
content
@Contract(pure=true) @NonNull TextComponent content(@NonNull String content)
Sets the plain text content.- Parameters:
content
- the plain text content- Returns:
- a copy of this component
- Since:
- 4.0.0
-
-