Interface SubscriptionBuilder<T extends org.bukkit.event.Event>

Type Parameters:
T - the event type

public interface SubscriptionBuilder<T extends org.bukkit.event.Event>
A builder for creating event subscriptions.
  • Method Details

    • priority

      @NotNull @NotNull SubscriptionBuilder<T> priority(@NotNull @NotNull org.bukkit.event.EventPriority priority)
      Sets the priority of the event listener.
      Parameters:
      priority - the event priority
      Returns:
      this builder
    • ignoreCancelled

      @NotNull @NotNull SubscriptionBuilder<T> ignoreCancelled(boolean ignoreCancelled)
      Sets whether to ignore cancelled events.
      Parameters:
      ignoreCancelled - true to ignore cancelled events, false otherwise
      Returns:
      this builder
    • filter

      @NotNull @NotNull SubscriptionBuilder<T> filter(@NotNull @NotNull Predicate<T> filter)
      Adds a filter to check before invoking the event handler.
      Parameters:
      filter - the event filter predicate
      Returns:
      this builder
    • handler

      @NotNull @NotNull EventSubscription<T> handler(@NotNull @NotNull Consumer<T> handler)
      Registers the event handler and activates the subscription.
      Parameters:
      handler - the event consumer
      Returns:
      the active event subscription