Package net.minecraft.text
Interface MutableText
- All Superinterfaces:
com.mojang.brigadier.Message,StringVisitable,Text
- All Known Implementing Classes:
BaseText,KeybindText,LiteralText,NbtText,NbtText.BlockNbtText,NbtText.EntityNbtText,NbtText.StorageNbtText,ScoreText,SelectorText,TranslatableText
public interface MutableText extends Text
A text with mutation operations.
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.text.StringVisitable
StringVisitable.StyledVisitor<T>, StringVisitable.Visitor<T>Nested classes/interfaces inherited from interface net.minecraft.text.Text
Text.Serializer -
Field Summary
Fields inherited from interface net.minecraft.text.StringVisitable
EMPTY, TERMINATE_VISIT -
Method Summary
Modifier and Type Method Description default MutableTextappend(String text)Appends a literal text with contenttextto this text's siblings.MutableTextappend(Text text)Appends a text to this text's siblings.default MutableTextfillStyle(Style styleOverride)Fills the absent parts of this text's style with definitions fromstyleOverride.default MutableTextformatted(Formatting formatting)Add a formatting to this text's style.default MutableTextformatted(Formatting[] formattings)Adds some formattings to this text's style.MutableTextsetStyle(Style style)Sets the style of this text.default MutableTextstyled(UnaryOperator<Style> styleUpdater)Updates the style of this text.Methods inherited from interface net.minecraft.text.Text
asOrderedText, asString, asTruncatedString, copy, getSiblings, getString, getStyle, shallowCopy, visit, visit, visitSelf, visitSelf
-
Method Details
-
setStyle
Sets the style of this text. -
append
Appends a literal text with contenttextto this text's siblings.- Parameters:
text- the literal text content
-
append
Appends a text to this text's siblings.- Parameters:
text- the sibling
-
styled
Updates the style of this text.- Parameters:
styleUpdater- the style updater- See Also:
Text.getStyle(),setStyle(Style)
-
fillStyle
Fills the absent parts of this text's style with definitions fromstyleOverride.- Parameters:
styleOverride- the style that provides definitions for absent definitions in this text's style- See Also:
Style.withParent(Style)
-
formatted
Adds some formattings to this text's style.- Parameters:
formattings- an array of formattings
-
formatted
Add a formatting to this text's style.- Parameters:
formatting- a formatting
-