Package net.minestom.server.entity.ai
Class TargetSelector
java.lang.Object
net.minestom.server.entity.ai.TargetSelector
- Direct Known Subclasses:
ClosestEntityTarget
,LastEntityDamagerTarget
The target selector is called each time the entity receives an "attack" instruction
without having a target.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract @Nullable Entity
Finds the target.@NotNull EntityCreature
Gets the entity linked to this target selector.
-
Field Details
-
entityCreature
-
-
Constructor Details
-
TargetSelector
-
-
Method Details
-
findTarget
Finds the target.Returning null means that this target selector didn't find any entity, the next
TargetSelector
will be called until the end of the list or an entity is found.- Returns:
- the target, null if not any
-
getEntityCreature
Gets the entity linked to this target selector.- Returns:
- the entity
-