Class PanicGoal
java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.PanicGoal
- Direct Known Subclasses:
Fox.FoxPanicGoal,Panda.PandaPanicGoal,Rabbit.RabbitPanicGoal,TamableAnimal.TamableAnimalPanicGoal,Turtle.TurtlePanicGoal
-
Nested Class Summary
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected final PathfinderMobprivate final Function<PathfinderMob, TagKey<DamageType>> protected doubleprotected doubleprotected doubleprotected final doublestatic final int -
Constructor Summary
ConstructorsConstructorDescriptionPanicGoal(PathfinderMob pMob, double pSpeedModifier) PanicGoal(PathfinderMob pMob, double pSpeedModifier, Function<PathfinderMob, TagKey<DamageType>> pPanicCausingDamageTypes) PanicGoal(PathfinderMob pMob, double pSpeedModifier, TagKey<DamageType> pPanicCausingDamageTypes) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleancanUse()protected booleanbooleanprotected BlockPoslookForWater(BlockGetter pLevel, Entity pEntity, int pRange) protected booleanvoidstart()voidstop()Methods inherited from class net.minecraft.world.entity.ai.goal.Goal
adjustedTickDelay, getFlags, getServerLevel, getServerLevel, isInterruptable, reducedTickDelay, requiresUpdateEveryTick, setFlags, tick, toString
-
Field Details
-
WATER_CHECK_DISTANCE_VERTICAL
public static final int WATER_CHECK_DISTANCE_VERTICAL- See Also:
-
mob
-
speedModifier
protected final double speedModifier -
posX
protected double posX -
posY
protected double posY -
posZ
protected double posZ -
isRunning
protected boolean isRunning -
panicCausingDamageTypes
-
-
Constructor Details
-
PanicGoal
-
PanicGoal
public PanicGoal(PathfinderMob pMob, double pSpeedModifier, TagKey<DamageType> pPanicCausingDamageTypes) -
PanicGoal
public PanicGoal(PathfinderMob pMob, double pSpeedModifier, Function<PathfinderMob, TagKey<DamageType>> pPanicCausingDamageTypes)
-
-
Method Details
-
canUse
public boolean canUse() -
shouldPanic
protected boolean shouldPanic() -
findRandomPosition
protected boolean findRandomPosition() -
isRunning
public boolean isRunning() -
start
public void start() -
stop
public void stop() -
canContinueToUse
public boolean canContinueToUse()- Overrides:
canContinueToUsein classGoal
-
lookForWater
-