Class EscapeDangerGoal

java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.EscapeDangerGoal
Direct Known Subclasses:
FoxEntity.EscapeWhenNotAggressiveGoal, PandaEntity.ExtinguishFireGoal, PolarBearEntity.PolarBearEscapeDangerGoal, RabbitEntity.EscapeDangerGoal, TurtleEntity.TurtleEscapeDangerGoal

public class EscapeDangerGoal
extends Goal
  • Field Details

    • mob

      protected final PathAwareEntity mob
    • speed

      protected final double speed
    • targetX

      protected double targetX
    • targetY

      protected double targetY
    • targetZ

      protected double targetZ
    • active

      protected boolean active
  • Constructor Details

    • EscapeDangerGoal

      public EscapeDangerGoal​(PathAwareEntity mob, double speed)
  • Method Details

    • canStart

      public boolean canStart()
      Specified by:
      canStart in class Goal
    • findTarget

      protected boolean findTarget()
    • isActive

      public boolean isActive()
    • start

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

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

      public boolean shouldContinue()
      Overrides:
      shouldContinue in class Goal
    • locateClosestWater

      @Nullable protected BlockPos locateClosestWater​(BlockView blockView, Entity entity, int rangeX, int rangeY)