Package net.glowstone.entity.ai
Class FollowPlayerTask
java.lang.Object
net.glowstone.entity.ai.EntityTask
net.glowstone.entity.ai.FollowPlayerTask
- All Implemented Interfaces:
Comparable<EntityTask>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
end
(GlowLivingEntity entity) Invoked when this task is being ended for this entity.void
execute
(GlowLivingEntity entity) Invoked each tick when this task is being executed for this entity.int
The maximum duration of this task.int
The minimum duration of this task.boolean
Whether this task is instant.boolean
shouldStart
(GlowLivingEntity entity) Whether the task should begin executing for this entity.void
start
(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
-
FollowPlayerTask
public FollowPlayerTask()
-
-
Method Details
-
isInstant
public boolean isInstant()Description copied from class:EntityTask
Whether this task is instant. An "instant" task will be executed every tick while the entity is alive.- Specified by:
isInstant
in classEntityTask
- Returns:
- the entity in question.
-
getDurationMin
public int getDurationMin()Description copied from class:EntityTask
The minimum duration of this task. This value is ignored if this task is instant.- Specified by:
getDurationMin
in classEntityTask
- Returns:
- the minimum duration of this task, in ticks.
-
getDurationMax
public int getDurationMax()Description copied from class:EntityTask
The maximum duration of this task. This value is ignored if this task is instant.- Specified by:
getDurationMax
in classEntityTask
- Returns:
- the maximum duration of this task, in ticks.
-
shouldStart
Description copied from class:EntityTask
Whether the task should begin executing for this entity.- Specified by:
shouldStart
in classEntityTask
- Parameters:
entity
- the entity in question.- Returns:
- true if the task should start, false otherwise.
-
start
Description copied from class:EntityTask
Invoked when this task is about to start for this entity.- Specified by:
start
in classEntityTask
- Parameters:
entity
- the entity in question.
-
end
Description copied from class:EntityTask
Invoked when this task is being ended for this entity.- Specified by:
end
in classEntityTask
- Parameters:
entity
- the entity in question.
-
execute
Description copied from class:EntityTask
Invoked each tick when this task is being executed for this entity.- Specified by:
execute
in classEntityTask
- Parameters:
entity
- the entity in question.
-