Packages com.phoenixplugins.sdk.api text

Interface Text

All Known Implementing Classes:
PlainText, ReplacementText, TextCompound

public interface Text
Represents a text component that can be used for various purposes such as messages, inventories, etc. Provides methods for creating, appending, and modifying components as well as retrieving their plain text representation.
  • Method Summary

    Modifier and Type
    Method
    Description
    default Text
    append(Text component)
    Appends another component to this one, producing a new combined component.
    default Text
    append(Text other, boolean withSpace)
    Appends another component to this one.
    static Text
    concat(String first, Text second)
     
    static Text
     
    static Text
    join(String delimiter, Text... components)
    Joins an array of components into a single Text, inserting the specified delimiter between each element.
    static Text
    plain(Object text)
    Creates a new plain text component with the given text.
    plain(List<?> text)
     
    default Text
    replaceText(String regex, Text component)
    Replaces all substrings of this component's text that match the given regular expression with the specified replacement component.
    default Text
    replaceText(String regex, Object text)
     
    String
     
  • Method Details

    • concat

      static Text concat(String first, Text second)
    • empty

      static Text empty()
    • plain

      static Text plain(Object text)
      Creates a new plain text component with the given text.
      Parameters:
      text - the text content of the component
      Returns:
      a new Text instance containing the specified plain text
    • plain

      static TextCompound plain(List<?> text)
    • join

      static Text join(String delimiter, Text... components)
      Joins an array of components into a single Text, inserting the specified delimiter between each element.

      This method preserves the original components' structure and formatting, so it is compatible with MiniMessage or any other Text-based system.

      Parameters:
      delimiter - the text to insert between each component
      components - the array of components to join
      Returns:
      a new Text representing all components joined with the delimiter or an empty Text if the array is null or empty
    • append

      default Text append(Text component)
      Appends another component to this one, producing a new combined component.
      Parameters:
      component - the component to append
      Returns:
      a new Text instance with the appended content
    • append

      default Text append(Text other, boolean withSpace)
      Appends another component to this one.
      Parameters:
      other - the component to append
      withSpace - if true, a space will be inserted before appending
      Returns:
      a new component representing the combined result
    • replaceText

      default Text replaceText(String regex, Text component)
      Replaces all substrings of this component's text that match the given regular expression with the specified replacement component.
      Parameters:
      regex - the regular expression to match
      component - the component to replace matches with
      Returns:
      a new Text instance with the replacements applied
    • replaceText

      default Text replaceText(String regex, Object text)
    • toPlainText

      String toPlainText()
Last updated 10 days ago
My Cart
Spider

Your cart is empty

Looks like the spiders padded through here. Pick a plugin and it will show up here. Continue shopping