public interface AffectEntityEvent extends TargetWorldEvent, Cancellable, CauseTracked
Entity
instances as a bulk action.
The constraint is that if an action can be deemed as necessary for selective
individualized processing, such as InteractEntityEvent.Attack
,
the actioned Event
is handled individually. If a bulk of
Entity
instances are being affected, for example by an
Explosion
"damaging" a varying amount of Entity
instances.
Other cases will be included as necessary.Modifier and Type | Method and Description |
---|---|
default List<? extends Entity> |
filterEntities(java.util.function.Predicate<Entity> predicate)
Filters out
Entity 's from getEntities()
to be affected by this event. |
default List<Entity> |
filterEntityLocations(java.util.function.Predicate<Location<World>> predicate)
Filters out
Location 's from
getEntities() to be affected by this event. |
List<Entity> |
getEntities()
Gets the
List who will be affected after event
resolution. |
List<EntitySnapshot> |
getEntitySnapshots()
Gets an
List of the entity data
un-affected by event changes. |
getTargetWorld
isCancelled, setCancelled
getCause
List<EntitySnapshot> getEntitySnapshots()
List
of the entity data
un-affected by event changes.List<Entity> getEntities()
List
who will be affected after event
resolution.default List<Entity> filterEntityLocations(java.util.function.Predicate<Location<World>> predicate)
Location
's from
getEntities()
to be affected by this event.
Locations for which the predicate returns false
will
be removed from getEntities()
.
predicate
- The predicate to use for filteringgetEntities()
default List<? extends Entity> filterEntities(java.util.function.Predicate<Entity> predicate)
Entity
's from getEntities()
to be affected by this event.
Entities for which the predicate returns false
will
be removed from getEntities()
.
predicate
- The predicate to use for filteringgetEntities()