Interface FormattedMessagePart


public interface FormattedMessagePart
Represents a formatted message that can be sent to players.

This interface abstracts the underlying protocol implementation, allowing plugins to create formatted messages without depending on protocol internals.

  • Method Details

    • getText

      @Nullable String getText()
      Gets the text content of this part.
      Returns:
      the text, or null if this is a container for children
    • getColor

      @Nullable String getColor()
      Gets the hex color of this part (e.g., "#FF5555").
      Returns:
      the color, or null if not set
    • isBold

      @Nullable Boolean isBold()
      Whether this part is bold.
      Returns:
      true if bold, false if not, null if unset
    • isItalic

      @Nullable Boolean isItalic()
      Whether this part is italic.
      Returns:
      true if italic, false if not, null if unset
    • isUnderlined

      @Nullable Boolean isUnderlined()
      Whether this part is underlined.
      Returns:
      true if underlined, false if not, null if unset
    • isStrikethrough

      @Nullable Boolean isStrikethrough()
      Whether this part has strikethrough.
      Returns:
      true if strikethrough, false if not, null if unset
    • getChildren

      @Nonnull List<FormattedMessagePart> getChildren()
      Gets child message parts.
      Returns:
      list of children, or empty list if none