Interface EventCondition.TrackedEvent<T extends EcsEvent>

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

public static interface EventCondition.TrackedEvent<T extends EcsEvent> extends EventCondition
A condition driven by a specific EcsEvent type, additionally filtered by the TrackedComponent of the entity that triggered it.

Use this when the condition only cares about events originating from entities that were spawned by the same world event (e.g. "an entity tracked by this event was killed"). The TrackedComponent carries the owning event's UUID and the context key that identifies which prefab or action spawned the entity.

Like EventCondition.Event, implementations must declare and register an inner Handler class.

  • 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, @Nonnull TrackedComponent tracked)
      Processes an incoming ECS event together with the tracking component of the entity that triggered it.
      Parameters:
      world - the world in which the event was fired
      event - the ECS event
      tracked - the TrackedComponent from the entity that triggered the event