Interface TextComponent

All Superinterfaces:
Buildable<TextComponent,TextComponent.Builder>, BuildableComponent<TextComponent,TextComponent.Builder>, Component

public interface TextComponent extends BuildableComponent<TextComponent,TextComponent.Builder>
A component that displays text.
  • Method Details

    • text

      static TextComponent.Builder text()
      Creates a new text component builder.
    • text

      static TextComponent text(String content)
      Creates a new text component with the specified content.
      Parameters:
      content - the content
      Returns:
      the text component
    • text

      static TextComponent text(String content, ComponentColor textColor)
      Creates a new text component with the specified content and text color.
      Parameters:
      content - the content
      textColor - the text color
      Returns:
      the text component
    • text

      static TextComponent text(String content, TextStyle textStyle)
      Creates a new text component with the specified content and text textStyle.
      Parameters:
      content - the content
      textStyle - the text textStyle
      Returns:
      the text component
    • text

      static TextComponent text(char ch)
      Creates a new text component with the specified character.
      Parameters:
      ch - the character
      Returns:
      the text component
    • text

      static TextComponent text(char ch, ComponentColor textColor)
      Creates a new text component with the specified character and text color.
      Parameters:
      ch - the character
      textColor - the text color
      Returns:
      the text component
    • text

      static TextComponent text(char ch, TextStyle textStyle)
      Creates a new text component with the specified character and text textStyle.
      Parameters:
      ch - the character
      textStyle - the text textStyle
      Returns:
      the text component
    • space

      static TextComponent space()
      Returns a text component with only a space character.
    • newline

      static TextComponent newline()
      Returns a text component with a newline character.
    • empty

      static TextComponent empty()
      Returns a text component with no content.
    • getContent

      String getContent()
      Returns the content of this component.