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.
  • Method Details

    • setStyle

      MutableText setStyle​(Style style)
      Sets the style of this text.
    • append

      default MutableText append​(String text)
      Appends a literal text with content text to this text's siblings.
      Parameters:
      text - the literal text content
    • append

      MutableText append​(Text text)
      Appends a text to this text's siblings.
      Parameters:
      text - the sibling
    • styled

      default MutableText styled​(UnaryOperator<Style> styleUpdater)
      Updates the style of this text.
      Parameters:
      styleUpdater - the style updater
      See Also:
      Text.getStyle(), setStyle(Style)
    • fillStyle

      default MutableText fillStyle​(Style styleOverride)
      Fills the absent parts of this text's style with definitions from styleOverride.
      Parameters:
      styleOverride - the style that provides definitions for absent definitions in this text's style
      See Also:
      Style.withParent(Style)
    • formatted

      default MutableText formatted​(Formatting[] formattings)
      Adds some formattings to this text's style.
      Parameters:
      formattings - an array of formattings
    • formatted

      default MutableText formatted​(Formatting formatting)
      Add a formatting to this text's style.
      Parameters:
      formatting - a formatting