Class MoveToTargetPosGoal

java.lang.Object
net.minecraft.entity.ai.goal.Goal
net.minecraft.entity.ai.goal.MoveToTargetPosGoal
Direct Known Subclasses:
CatSitOnBlockGoal, DrownedEntity.LeaveWaterGoal, FoxEntity.EatSweetBerriesGoal, GoToOwnerAndPurrGoal, RabbitEntity.EatCarrotCropGoal, StepAndDestroyBlockGoal, StriderEntity.GoBackToLavaGoal, TurtleEntity.LayEggGoal, TurtleEntity.WanderInWaterGoal

public abstract class MoveToTargetPosGoal
extends Goal
  • Field Details

    • mob

      protected final PathAwareEntity mob
    • speed

      public final double speed
    • cooldown

      protected int cooldown
    • tryingTime

      protected int tryingTime
    • safeWaitingTime

      private int safeWaitingTime
    • targetPos

      protected BlockPos targetPos
    • reached

      private boolean reached
    • range

      private final int range
    • maxYDifference

      private final int maxYDifference
    • lowestY

      protected int lowestY
  • Constructor Details

    • MoveToTargetPosGoal

      public MoveToTargetPosGoal​(PathAwareEntity mob, double speed, int range)
    • MoveToTargetPosGoal

      public MoveToTargetPosGoal​(PathAwareEntity mob, double speed, int range, int maxYDifference)
  • Method Details

    • canStart

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

      protected int getInterval​(PathAwareEntity mob)
    • shouldContinue

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

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

      protected void startMovingToTarget()
    • getDesiredSquaredDistanceToTarget

      public double getDesiredSquaredDistanceToTarget()
    • getTargetPos

      protected BlockPos getTargetPos()
    • tick

      public void tick()
      Overrides:
      tick in class Goal
    • shouldResetPath

      public boolean shouldResetPath()
    • hasReached

      protected boolean hasReached()
    • findTargetPos

      protected boolean findTargetPos()
    • isTargetPos

      protected abstract boolean isTargetPos​(WorldView world, BlockPos pos)