Class MoveToBlockGoal

java.lang.Object
net.minecraft.world.entity.ai.goal.Goal
net.minecraft.world.entity.ai.goal.MoveToBlockGoal
Direct Known Subclasses:
CatLieOnBedGoal, CatSitOnBlockGoal, Drowned.DrownedGoToBeachGoal, Fox.FoxEatBerriesGoal, Rabbit.RaidGardenGoal, RemoveBlockGoal, Strider.StriderGoToLavaGoal, Turtle.TurtleGoToWaterGoal, Turtle.TurtleLayEggGoal

public abstract class MoveToBlockGoal extends Goal
  • Field Details

    • GIVE_UP_TICKS

      private static final int GIVE_UP_TICKS
      See Also:
    • STAY_TICKS

      private static final int STAY_TICKS
      See Also:
    • INTERVAL_TICKS

      private static final int INTERVAL_TICKS
      See Also:
    • mob

      protected final PathfinderMob mob
    • speedModifier

      public final double speedModifier
    • nextStartTick

      protected int nextStartTick
    • tryTicks

      protected int tryTicks
    • maxStayTicks

      private int maxStayTicks
    • blockPos

      protected BlockPos blockPos
    • reachedTarget

      private boolean reachedTarget
    • searchRange

      private final int searchRange
    • verticalSearchRange

      private final int verticalSearchRange
    • verticalSearchStart

      protected int verticalSearchStart
  • Constructor Details

    • MoveToBlockGoal

      public MoveToBlockGoal(PathfinderMob p_25609_, double p_25610_, int p_25611_)
    • MoveToBlockGoal

      public MoveToBlockGoal(PathfinderMob p_25613_, double p_25614_, int p_25615_, int p_25616_)
  • Method Details

    • canUse

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

      protected int nextStartTick(PathfinderMob p_25618_)
    • canContinueToUse

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

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

      protected void moveMobToBlock()
    • acceptedDistance

      public double acceptedDistance()
    • getMoveToTarget

      protected BlockPos getMoveToTarget()
    • requiresUpdateEveryTick

      public boolean requiresUpdateEveryTick()
      Overrides:
      requiresUpdateEveryTick in class Goal
    • tick

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

      public boolean shouldRecalculatePath()
    • isReachedTarget

      protected boolean isReachedTarget()
    • findNearestBlock

      protected boolean findNearestBlock()
    • isValidTarget

      protected abstract boolean isValidTarget(LevelReader p_25619_, BlockPos p_25620_)