Class LinearComponents

java.lang.Object
net.kyori.adventure.text.LinearComponents

public final class LinearComponents extends Object
A utility class that allows components to be created where styles can be specified inline.
Since:
4.0.0
  • Method Details

    • linear

      public static Component linear(ComponentBuilderApplicable... applicables)
      Styles apply to all components after them until a conflicting style is discovered
          Component message = LinearComponents.linear(NamedTextColor.RED, translatable("welcome.message"), TextDecoration.BOLD, text(" SERVER));
        
      In this example all the text is red, but only the last word is bold.
          Component message = LinearComponents.linear(NamedTextColor.GREEN, text("I am green. "), NamedTextColor.GRAY, text("I am gray."));
        
      In this example, the first text is green and the second is gray.
      Parameters:
      applicables - the things used to make the component
      Returns:
      a component
      Since:
      4.0.0