Interface ScopedComponent<C extends Component>

Type Parameters:
C - the component type
All Superinterfaces:
Component, ComponentBuilderApplicable, ComponentLike, net.kyori.examination.Examinable, HoverEventSource<Component>
All Known Subinterfaces:
BlockNBTComponent, EntityNBTComponent, KeybindComponent, ScoreComponent, SelectorComponent, StorageNBTComponent, TextComponent, TranslatableComponent

public interface ScopedComponent<C extends Component>
extends Component
Some magic to change return types.
Since:
4.0.0
  • Method Details

    • children

      @NonNull C children​(@NonNull List<? extends ComponentLike> children)
      Description copied from interface: Component
      Sets the list of children.

      The contents of children will be copied.

      Specified by:
      children in interface Component
      Parameters:
      children - the children
      Returns:
      a component with the children set
    • style

      @NonNull C style​(@NonNull Style style)
      Description copied from interface: Component
      Sets the style of this component.
      Specified by:
      style in interface Component
      Parameters:
      style - the style
      Returns:
      a component
    • style

      default @NonNull C style​(@NonNull Consumer<Style.Builder> style)
      Description copied from interface: Component
      Sets the style of this component.
      Specified by:
      style in interface Component
      Parameters:
      style - the style consumer
      Returns:
      a component
    • style

      default @NonNull C style​(@NonNull Style.Builder style)
      Description copied from interface: Component
      Sets the style of this component.
      Specified by:
      style in interface Component
      Parameters:
      style - the style
      Returns:
      a component
    • mergeStyle

      default @NonNull C mergeStyle​(@NonNull Component that)
      Description copied from interface: Component
      Merges from another style into this component's style.
      Specified by:
      mergeStyle in interface Component
      Parameters:
      that - the other style
      Returns:
      a component
    • mergeStyle

      default @NonNull C mergeStyle​(@NonNull Component that, @NonNull Style.Merge @NonNull ... merges)
      Description copied from interface: Component
      Merges from another style into this component's style.
      Specified by:
      mergeStyle in interface Component
      Parameters:
      that - the other style
      merges - the style parts to merge
      Returns:
      a component
    • append

      default @NonNull C append​(@NonNull Component component)
      Description copied from interface: Component
      Appends a component to this component.
      Specified by:
      append in interface Component
      Parameters:
      component - the component to append
      Returns:
      a component with the component added
    • append

      default @NonNull C append​(@NonNull ComponentLike component)
      Description copied from interface: Component
      Appends a component to this component.
      Specified by:
      append in interface Component
      Parameters:
      component - the component to append
      Returns:
      a component with the component added
    • append

      default @NonNull C append​(@NonNull ComponentBuilder<?,​?> builder)
      Description copied from interface: Component
      Appends a component to this component.
      Specified by:
      append in interface Component
      Parameters:
      builder - the component to append
      Returns:
      a component with the component added
    • mergeStyle

      default @NonNull C mergeStyle​(@NonNull Component that, @NonNull Set<Style.Merge> merges)
      Description copied from interface: Component
      Merges from another style into this component's style.
      Specified by:
      mergeStyle in interface Component
      Parameters:
      that - the other style
      merges - the style parts to merge
      Returns:
      a component
    • color

      default @NonNull C color​(@Nullable TextColor color)
      Description copied from interface: Component
      Sets the color of this component.
      Specified by:
      color in interface Component
      Parameters:
      color - the color
      Returns:
      a component
    • colorIfAbsent

      default @NonNull C colorIfAbsent​(@Nullable TextColor color)
      Description copied from interface: Component
      Sets the color if there isn't one set already.
      Specified by:
      colorIfAbsent in interface Component
      Parameters:
      color - the color
      Returns:
      this builder
    • decorate

      default @NonNull Component decorate​(@NonNull TextDecoration decoration)
      Description copied from interface: Component
      Sets the state of decoration to TextDecoration.State.TRUE on this component.
      Specified by:
      decorate in interface Component
      Parameters:
      decoration - the decoration
      Returns:
      a component
    • decoration

      default @NonNull C decoration​(@NonNull TextDecoration decoration, boolean flag)
      Description copied from interface: Component
      Sets the state of a decoration on this component.
      Specified by:
      decoration in interface Component
      Parameters:
      decoration - the decoration
      flag - true if this component should have the decoration, false if this component should not have the decoration
      Returns:
      a component
    • decoration

      default @NonNull C decoration​(@NonNull TextDecoration decoration, @NonNull TextDecoration.State state)
      Description copied from interface: Component
      Sets the value of a decoration on this component.
      Specified by:
      decoration in interface Component
      Parameters:
      decoration - the decoration
      state - TextDecoration.State.TRUE if this component should have the decoration, TextDecoration.State.FALSE if this component should not have the decoration, and TextDecoration.State.NOT_SET if the decoration should not have a set value
      Returns:
      a component
    • clickEvent

      default @NonNull C clickEvent​(@Nullable ClickEvent event)
      Description copied from interface: Component
      Sets the click event of this component.
      Specified by:
      clickEvent in interface Component
      Parameters:
      event - the click event
      Returns:
      a component
    • hoverEvent

      default @NonNull C hoverEvent​(@Nullable HoverEventSource<?> event)
      Description copied from interface: Component
      Sets the hover event of this component.
      Specified by:
      hoverEvent in interface Component
      Parameters:
      event - the hover event source
      Returns:
      a component
    • insertion

      default @NonNull C insertion​(@Nullable String insertion)
      Description copied from interface: Component
      Sets the string to be inserted when this component is shift-clicked.
      Specified by:
      insertion in interface Component
      Parameters:
      insertion - the insertion string
      Returns:
      a component