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

public class PanicGoal extends Goal
  • Field Details

    • WATER_CHECK_DISTANCE_VERTICAL

      public static final int WATER_CHECK_DISTANCE_VERTICAL
      See Also:
    • mob

      protected final PathfinderMob mob
    • speedModifier

      protected final double speedModifier
    • posX

      protected double posX
    • posY

      protected double posY
    • posZ

      protected double posZ
    • isRunning

      protected boolean isRunning
    • panicCausingDamageTypes

      private final Function<PathfinderMob,TagKey<DamageType>> panicCausingDamageTypes
  • Constructor Details

  • Method Details

    • canUse

      public boolean canUse()
      Specified by:
      canUse in class Goal
    • shouldPanic

      protected boolean shouldPanic()
    • findRandomPosition

      protected boolean findRandomPosition()
    • isRunning

      public boolean isRunning()
    • start

      public void start()
      Overrides:
      start in class Goal
    • stop

      public void stop()
      Overrides:
      stop in class Goal
    • canContinueToUse

      public boolean canContinueToUse()
      Overrides:
      canContinueToUse in class Goal
    • lookForWater

      @Nullable protected BlockPos lookForWater(BlockGetter p_198173_, Entity p_198174_, int p_198175_)