Package net.minestom.server.entity.ai
Class GoalSelector
java.lang.Object
net.minestom.server.entity.ai.GoalSelector
- Direct Known Subclasses:
DoNothingGoal
,EatBlockGoal
,FollowTargetGoal
,MeleeAttackGoal
,RandomLookAroundGoal
,RandomStrollGoal
public abstract class GoalSelector
extends java.lang.Object
-
Field Summary
Fields Modifier and Type Field Description protected EntityCreature
entityCreature
-
Constructor Summary
Constructors Constructor Description GoalSelector(EntityCreature entityCreature)
-
Method Summary
Modifier and Type Method Description abstract void
end()
Ends thisGoalSelector
.Entity
findTarget()
Finds a target based on the entityTargetSelector
.abstract boolean
shouldEnd()
Whether or not thisGoalSelector
should end.abstract boolean
shouldStart()
Whether or not thisGoalSelector
should start.abstract void
start()
Starts thisGoalSelector
.abstract void
tick(long time)
Called every tick when thisGoalSelector
is running
-
Field Details
-
Constructor Details
-
Method Details
-
shouldStart
public abstract boolean shouldStart()Whether or not thisGoalSelector
should start.- Returns:
- true to start
-
start
public abstract void start()Starts thisGoalSelector
. -
tick
public abstract void tick(long time)Called every tick when thisGoalSelector
is running- Parameters:
time
- the time of the update in milliseconds
-
shouldEnd
public abstract boolean shouldEnd()Whether or not thisGoalSelector
should end.- Returns:
- true to end
-
end
public abstract void end()Ends thisGoalSelector
. -
findTarget
Finds a target based on the entityTargetSelector
.- Returns:
- the target entity, null if not found
-