Package net.minecraft.entity.ai.goal
Class FleeEntityGoal<T extends LivingEntity>
java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.FleeEntityGoal<T>
- Direct Known Subclasses:
CatEntity.CatFleeGoal
,OcelotEntity.FleeGoal
,PandaEntity.PandaFleeGoal
,RabbitEntity.FleeGoal
,WolfEntity.AvoidLlamaGoal
public class FleeEntityGoal<T extends LivingEntity> extends Goal
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.entity.ai.goal.Goal
Goal.Control
-
Field Summary
Fields Modifier and Type Field Description protected Class<T>
classToFleeFrom
protected Predicate<LivingEntity>
extraInclusionSelector
private double
fastSpeed
protected float
fleeDistance
protected EntityNavigation
fleeingEntityNavigation
protected Path
fleePath
protected Predicate<LivingEntity>
inclusionSelector
protected PathAwareEntity
mob
private double
slowSpeed
protected T
targetEntity
private TargetPredicate
withinRangePredicate
-
Constructor Summary
Constructors Constructor Description FleeEntityGoal(PathAwareEntity mob, Class<T> fleeFromType, float distance, double slowSpeed, double fastSpeed)
FleeEntityGoal(PathAwareEntity fleeingEntity, Class<T> classToFleeFrom, float fleeDistance, double fleeSlowSpeed, double fleeFastSpeed, Predicate<LivingEntity> inclusionSelector)
FleeEntityGoal(PathAwareEntity mob, Class<T> fleeFromType, Predicate<LivingEntity> extraInclusionSelector, float distance, double slowSpeed, double fastSpeed, Predicate<LivingEntity> inclusionSelector)
-
Method Summary
Modifier and Type Method Description boolean
canStart()
boolean
shouldContinue()
void
start()
void
stop()
void
tick()
Methods inherited from class net.minecraft.entity.ai.goal.Goal
canStop, getControls, setControls, toString
-
Field Details
-
mob
-
slowSpeed
private final double slowSpeed -
fastSpeed
private final double fastSpeed -
targetEntity
-
fleeDistance
protected final float fleeDistance -
fleePath
-
classToFleeFrom
-
extraInclusionSelector
-
inclusionSelector
-
withinRangePredicate
-
-
Constructor Details
-
FleeEntityGoal
public FleeEntityGoal(PathAwareEntity mob, Class<T> fleeFromType, float distance, double slowSpeed, double fastSpeed) -
FleeEntityGoal
public FleeEntityGoal(PathAwareEntity mob, Class<T> fleeFromType, Predicate<LivingEntity> extraInclusionSelector, float distance, double slowSpeed, double fastSpeed, Predicate<LivingEntity> inclusionSelector) -
FleeEntityGoal
public FleeEntityGoal(PathAwareEntity fleeingEntity, Class<T> classToFleeFrom, float fleeDistance, double fleeSlowSpeed, double fleeFastSpeed, Predicate<LivingEntity> inclusionSelector)
-
-
Method Details
-
canStart
public boolean canStart() -
shouldContinue
public boolean shouldContinue()- Overrides:
shouldContinue
in classGoal
-
start
public void start() -
stop
public void stop() -
tick
public void tick()
-