Interface EventCondition.Event<T extends EcsEvent>

Type Parameters:
T - the ECS event type this condition listens for
All Superinterfaces:
EventCondition
All Known Implementing Classes:
EventEndCondition, SignalCondition
Enclosing interface:
EventCondition

public static interface EventCondition.Event<T extends EcsEvent> extends EventCondition
A condition driven by a specific EcsEvent type rather than polling.

Implementations must also declare a handler class that extends the appropriate block or entity handler class found in ConditionEventHandler and registered to the WorldEventsPlugin via the corresponding registration method.

  • Method Details

    • eventType

      Class<T> eventType()
      Returns the exact class of the ECS event this condition handles.
      Returns:
      the event class; must match the type parameter T exactly
    • handle

      void handle(@Nonnull World world, @Nonnull T event)
      Processes an incoming ECS event and updates internal state.

      This is called for every matching event, not only for events that are relevant to this specific condition instance. Implementations must check (e.g. by comparing UUIDs) whether the event is relevant before updating state.

      Parameters:
      world - the world in which the event was fired
      event - the ECS event