Package net.glowstone.entity.ai
Class LookAtPlayerTask
java.lang.Object
net.glowstone.entity.ai.EntityTask
net.glowstone.entity.ai.LookAtPlayerTask
- All Implemented Interfaces:
Comparable<EntityTask>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidend(GlowLivingEntity entity) Invoked when this task is being ended for this entity.voidexecute(GlowLivingEntity entity) Invoked each tick when this task is being executed for this entity.intThe maximum duration of this task.intThe minimum duration of this task.booleanWhether this task is instant.booleanshouldStart(GlowLivingEntity entity) Whether the task should begin executing for this entity.voidstart(GlowLivingEntity entity) Invoked when this task is about to start for this entity.Methods inherited from class net.glowstone.entity.ai.EntityTask
compareTo, getName, isExecuting, isPaused, pause, pulse, reset, resume
-
Constructor Details
-
LookAtPlayerTask
public LookAtPlayerTask()
-
-
Method Details
-
isInstant
public boolean isInstant()Description copied from class:EntityTaskWhether this task is instant. An "instant" task will be executed every tick while the entity is alive.- Specified by:
isInstantin classEntityTask- Returns:
- the entity in question.
-
getDurationMin
public int getDurationMin()Description copied from class:EntityTaskThe minimum duration of this task. This value is ignored if this task is instant.- Specified by:
getDurationMinin classEntityTask- Returns:
- the minimum duration of this task, in ticks.
-
getDurationMax
public int getDurationMax()Description copied from class:EntityTaskThe maximum duration of this task. This value is ignored if this task is instant.- Specified by:
getDurationMaxin classEntityTask- Returns:
- the maximum duration of this task, in ticks.
-
shouldStart
Description copied from class:EntityTaskWhether the task should begin executing for this entity.- Specified by:
shouldStartin classEntityTask- Parameters:
entity- the entity in question.- Returns:
- true if the task should start, false otherwise.
-
start
Description copied from class:EntityTaskInvoked when this task is about to start for this entity.- Specified by:
startin classEntityTask- Parameters:
entity- the entity in question.
-
end
Description copied from class:EntityTaskInvoked when this task is being ended for this entity.- Specified by:
endin classEntityTask- Parameters:
entity- the entity in question.
-
execute
Description copied from class:EntityTaskInvoked each tick when this task is being executed for this entity.- Specified by:
executein classEntityTask- Parameters:
entity- the entity in question.
-