Class AvoidEntityGoal<T extends LivingEntity>
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.AvoidEntityGoal<T>
- Direct Known Subclasses:
Cat.CatAvoidEntityGoal, Ocelot.OcelotAvoidEntityGoal, Panda.PandaAvoidGoal, Rabbit.RabbitAvoidEntityGoal, Wolf.WolfAvoidEntityGoal
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionClass of entity this behavior seeks to avoidprivate final TargetingConditionsprotected final Predicate<? super LivingEntity> protected final floatprotected final PathfinderMobprotected @Nullable Pathprotected final PathNavigationprotected final Predicate<? super LivingEntity> private final doubleprotected @Nullable Tprivate final double -
Constructor Summary
ConstructorsConstructorDescriptionAvoidEntityGoal(PathfinderMob mob, Class<T> avoidClass, float maxDist, double walkSpeedModifier, double sprintSpeedModifier) AvoidEntityGoal(PathfinderMob mob, Class<T> avoidClass, float maxDist, double walkSpeedModifier, double sprintSpeedModifier, Predicate<? super LivingEntity> predicateOnAvoidEntity) AvoidEntityGoal(PathfinderMob mob, Class<T> avoidClass, Predicate<LivingEntity> avoidPredicate, float maxDist, double walkSpeedModifier, double sprintSpeedModifier, Predicate<? super LivingEntity> predicateOnAvoidEntity) Goal that helps mobs avoid mobs of a specific class -
Method Summary
Methods inherited from class Goal
adjustedTickDelay, getFlags, getServerLevel, getServerLevel, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, toString
-
Field Details
-
mob
-
walkSpeedModifier
private final double walkSpeedModifier -
sprintSpeedModifier
private final double sprintSpeedModifier -
toAvoid
-
maxDist
protected final float maxDist -
path
-
avoidClass
Class of entity this behavior seeks to avoid -
avoidPredicate
-
predicateOnAvoidEntity
-
avoidEntityTargeting
-
-
Constructor Details
-
AvoidEntityGoal
public AvoidEntityGoal(PathfinderMob mob, Class<T> avoidClass, float maxDist, double walkSpeedModifier, double sprintSpeedModifier) -
AvoidEntityGoal
public AvoidEntityGoal(PathfinderMob mob, Class<T> avoidClass, Predicate<LivingEntity> avoidPredicate, float maxDist, double walkSpeedModifier, double sprintSpeedModifier, Predicate<? super LivingEntity> predicateOnAvoidEntity) Goal that helps mobs avoid mobs of a specific class -
AvoidEntityGoal
public AvoidEntityGoal(PathfinderMob mob, Class<T> avoidClass, float maxDist, double walkSpeedModifier, double sprintSpeedModifier, Predicate<? super LivingEntity> predicateOnAvoidEntity)
-
-
Method Details
-
canUse
-
canContinueToUse
public boolean canContinueToUse()- Overrides:
canContinueToUsein classGoal
-
start
-
stop
-
tick
-