Package net.minestom.server.entity.ai
Interface EntityAI
- All Known Implementing Classes:
EntityCreature
public interface EntityAI
Represents an entity which can contain
goal selectors and target selectors.
Both types of selectors are being stored in AI groups.
For every group there could be only a single goal selector running at a time,
but multiple groups are independent of each other, so each of them can have own goal selector running.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddAIGroup(List<GoalSelector> goalSelectors, List<TargetSelector> targetSelectors) Adds new AI group to this entity, consisting of the givengoal selectorsandtarget selectors.default voidaddAIGroup(EntityAIGroup group) Adds new AI group to this entity.default voidaiTick(long time) Gets the AI groups of this entity.
-
Method Details
-
getAIGroups
Collection<EntityAIGroup> getAIGroups()Gets the AI groups of this entity.- Returns:
- a modifiable collection of AI groups of this entity.
-
addAIGroup
Adds new AI group to this entity.- Parameters:
group- a group to be added.
-
addAIGroup
Adds new AI group to this entity, consisting of the givengoal selectorsandtarget selectors. Their order is also a priority: the lower element index is, the higher priority is.- Parameters:
goalSelectors- goal selectors of the group.targetSelectors- target selectors of the group.
-
aiTick
default void aiTick(long time)
-