Interface Modifying

All Superinterfaces:
Tag

@OverrideOnly public interface Modifying extends Tag
A tag that can transform a whole subtree of nodes.
Since:
4.10.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.kyori.adventure.text.minimessage.tag.Tag

    Tag.Argument
  • Method Summary

    Modifier and Type
    Method
    Description
    apply(@NotNull Component current, int depth)
    Applies this transformation for the current component.
    default void
    Called after the entire tree has been visited.
    default void
    visit(@NotNull Node current, int depth)
    Method called once for every element in the subtree, allowing calculations to be made before application.
  • Method Details

    • visit

      default void visit(@NotNull @NotNull Node current, int depth)
      Method called once for every element in the subtree, allowing calculations to be made before application.
      Parameters:
      current - the current element in the subtree
      depth - depth in the tree this node is at
      Since:
      4.10.0
    • postVisit

      default void postVisit()
      Called after the entire tree has been visited.

      This allows for finalizing calculations made during the tree visit, but before actual application to the child components of this tag.

      Since:
      4.10.0
    • apply

      Component apply(@NotNull @NotNull Component current, int depth)
      Applies this transformation for the current component.

      This gets called after the component tree has been assembled, however, the tree can still be modified at this point if desired.

      Parameters:
      current - the current component
      depth - the depth of the tree the current component is at
      Returns:
      the new parent
      Since:
      4.10.0