Interface Modifier<C extends ModifierContext>

Type Parameters:
C - context type

public interface Modifier<C extends ModifierContext>
A prioritized calculation step in a ModifierType pipeline.
  • Method Summary

    Modifier and Type
    Method
    Description
    default @Nullable String
    displayTag(C context)
    Optional legacy/colorized badge tag (e.g.
    double
    evaluate(C context)
    Evaluates the modifier's operand for the given context.
    @NotNull net.kyori.adventure.key.Key
    key()
     
    @NotNull Operation
     
    default int
     
  • Method Details

    • key

      @NotNull @NotNull net.kyori.adventure.key.Key key()
      Returns:
      unique namespaced key of this modifier (e.g. Key.key("myaddon", "vip_boost"))
    • priority

      default int priority()
      Returns:
      priority ordering (lower runs earlier; default is 0)
    • operation

      @NotNull @NotNull Operation operation()
      Returns:
      mathematical operation to perform
    • evaluate

      double evaluate(@NotNull C context)
      Evaluates the modifier's operand for the given context. Returning the identity value (0.0 for Operation.ADD, 1.0 for Operation.MULTIPLY, or Double.NaN for any operation) skips this modifier for the current evaluation.
    • displayTag

      @Nullable default @Nullable String displayTag(@NotNull C context)
      Optional legacy/colorized badge tag (e.g. "&#FFAA00[VIP]") to display on rate holograms and in /sab api breakdowns when this modifier actively contributes.