Class ActorQuery<T extends IActor,Q extends ActorQuery<T,Q>>
- Type Parameters:
T- the type of actor being queried (NPC or Player)Q- the concrete query type (for method chaining)
- All Implemented Interfaces:
Predicate<T>
- Direct Known Subclasses:
NPCQuery,PlayerQuery
Actors are entities that can move, perform animations, and interact with other entities.
This includes both NPCs and players. This class extends SceneEntityQuery with
actor-specific filtering capabilities:
- Combat levels
- Animation IDs
- Interaction targets
- Movement state
- Death state
-
Field Summary
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedActorQuery(Supplier<List<T>> supplier) Constructs a new actor query with the specified entity supplier. -
Method Summary
Modifier and TypeMethodDescriptionanimations(int... animations) Filters actors by their current animation.Filters actors by their death state.levels(int... levels) Filters actors by their combat levels.Filters actors by their movement state.targeting(Interactable... targets) Filters actors by their current interaction target.Filters for actors that have no current target.booleanTests whether an actor passes all accumulated filter criteria.Methods inherited from class net.storm.api.query.entities.SceneEntityQuery
actionContains, actions, distance, distance, distance, ids, localLocations, locations, nameContains, names, within, worldView
-
Constructor Details
-
ActorQuery
Constructs a new actor query with the specified entity supplier.- Parameters:
supplier- a supplier that provides the list of actors to query
-
-
Method Details
-
levels
Filters actors by their combat levels.Only actors with a combat level matching one of the specified values will be included.
- Parameters:
levels- the combat levels to filter by- Returns:
- this query instance for method chaining
-
animations
Filters actors by their current animation.Only actors performing an animation matching one of the specified IDs will be included.
- Parameters:
animations- the animation IDs to filter by- Returns:
- this query instance for method chaining
-
targeting
Filters actors by their current interaction target.Only actors targeting one of the specified interactables will be included.
- Parameters:
targets- the interaction targets to filter by- Returns:
- this query instance for method chaining
-
targetless
Filters for actors that have no current target.Only actors that are not interacting with any entity will be included.
- Returns:
- this query instance for method chaining
-
moving
Filters actors by their movement state.Only actors whose movement state matches the specified value will be included.
- Parameters:
moving-trueto include only moving actors,falsefor stationary actors- Returns:
- this query instance for method chaining
-
dead
Filters actors by their death state.Only actors whose death state matches the specified value will be included.
- Parameters:
dead-trueto include only dead actors,falsefor alive actors- Returns:
- this query instance for method chaining
-
test
Tests whether an actor passes all accumulated filter criteria.This method checks the actor against all configured filters including combat level, animation, movement state, interaction target, and death state, in addition to the parent class filters.
-