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>classToFleeFromprotected Predicate<LivingEntity>extraInclusionSelectorprivate doublefastSpeedprotected floatfleeDistanceprotected EntityNavigationfleeingEntityNavigationprotected PathfleePathprotected Predicate<LivingEntity>inclusionSelectorprotected PathAwareEntitymobprivate doubleslowSpeedprotected TtargetEntityprivate TargetPredicatewithinRangePredicate -
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 booleancanStart()booleanshouldContinue()voidstart()voidstop()voidtick()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:
shouldContinuein classGoal
-
start
public void start() -
stop
public void stop() -
tick
public void tick()
-