public interface ITextComponent extends java.lang.Iterable<ITextComponent>
Modifier and Type | Interface and Description |
---|---|
static class |
ITextComponent.Serializer |
Modifier and Type | Method and Description |
---|---|
ITextComponent |
appendSibling(ITextComponent component)
Adds a new component to the end of the sibling list, setting that component's style's parent style to this
component's style.
|
ITextComponent |
appendText(java.lang.String text)
Adds a new component to the end of the sibling list, with the specified text.
|
ITextComponent |
createCopy()
Creates a copy of this component.
|
java.lang.String |
getFormattedText()
Gets the text of this component and all sibling components, with formatting codes added for rendering.
|
java.util.List<ITextComponent> |
getSiblings()
Gets the sibling components of this one.
|
Style |
getStyle()
Gets the style of this component.
|
java.lang.String |
getUnformattedComponentText()
Gets the raw content of this component (but not its sibling components), without any formatting codes.
|
java.lang.String |
getUnformattedText()
Gets the text of this component and all sibling components, without any formatting codes.
|
ITextComponent |
setStyle(Style style)
Sets the style of this component and updates the parent style of all of the sibling components.
|
ITextComponent setStyle(Style style)
Style getStyle()
setStyle(Style)
again after modifying it).
If this component's style is currently null
, it will be initialized to the default style, and the
parent style of all sibling components will be set to that style. (IE, changes to this style will also be
reflected in sibling components.)
This method never returns null
.ITextComponent appendText(java.lang.String text)
appendSibling(ITextComponent)
with a new TextComponentString
.ITextComponent appendSibling(ITextComponent component)
java.lang.String getUnformattedComponentText()
TextComponentString
, but it's the translated text for a TextComponentTranslation
and it's the score value for a TextComponentScore
.java.lang.String getUnformattedText()
java.lang.String getFormattedText()
java.util.List<ITextComponent> getSiblings()
ITextComponent createCopy()