Class PathNavigation

java.lang.Object
net.minecraft.world.entity.ai.navigation.PathNavigation
Direct Known Subclasses:
AmphibiousPathNavigation, FlyingPathNavigation, GroundPathNavigation, WaterBoundPathNavigation

public abstract class PathNavigation extends Object
  • Field Details

    • MAX_TIME_RECOMPUTE

      private static final int MAX_TIME_RECOMPUTE
      See Also:
    • STUCK_CHECK_INTERVAL

      private static final int STUCK_CHECK_INTERVAL
      See Also:
    • STUCK_THRESHOLD_DISTANCE_FACTOR

      private static final float STUCK_THRESHOLD_DISTANCE_FACTOR
      See Also:
    • mob

      protected final Mob mob
    • level

      protected final Level level
    • path

      @Nullable protected Path path
    • speedModifier

      protected double speedModifier
    • tick

      protected int tick
    • lastStuckCheck

      protected int lastStuckCheck
    • lastStuckCheckPos

      protected Vec3 lastStuckCheckPos
    • timeoutCachedNode

      protected Vec3i timeoutCachedNode
    • timeoutTimer

      protected long timeoutTimer
    • lastTimeoutCheck

      protected long lastTimeoutCheck
    • timeoutLimit

      protected double timeoutLimit
    • maxDistanceToWaypoint

      protected float maxDistanceToWaypoint
    • hasDelayedRecomputation

      protected boolean hasDelayedRecomputation
    • timeLastRecompute

      protected long timeLastRecompute
    • nodeEvaluator

      protected NodeEvaluator nodeEvaluator
    • targetPos

      @Nullable private BlockPos targetPos
    • reachRange

      private int reachRange
    • maxVisitedNodesMultiplier

      private float maxVisitedNodesMultiplier
    • pathFinder

      private final PathFinder pathFinder
    • isStuck

      private boolean isStuck
  • Constructor Details

    • PathNavigation

      public PathNavigation(Mob p_26515_, Level p_26516_)
  • Method Details

    • resetMaxVisitedNodesMultiplier

      public void resetMaxVisitedNodesMultiplier()
    • setMaxVisitedNodesMultiplier

      public void setMaxVisitedNodesMultiplier(float p_26530_)
    • getTargetPos

      @Nullable public BlockPos getTargetPos()
    • createPathFinder

      protected abstract PathFinder createPathFinder(int p_26531_)
    • setSpeedModifier

      public void setSpeedModifier(double p_26518_)
    • recomputePath

      public void recomputePath()
    • createPath

      @Nullable public final Path createPath(double p_26525_, double p_26526_, double p_26527_, int p_26528_)
    • createPath

      @Nullable public Path createPath(Stream<BlockPos> p_26557_, int p_26558_)
    • createPath

      @Nullable public Path createPath(Set<BlockPos> p_26549_, int p_26550_)
    • createPath

      @Nullable public Path createPath(BlockPos p_26546_, int p_26547_)
    • createPath

      @Nullable public Path createPath(BlockPos p_148219_, int p_148220_, int p_148221_)
    • createPath

      @Nullable public Path createPath(Entity p_26534_, int p_26535_)
    • createPath

      @Nullable protected Path createPath(Set<BlockPos> p_26552_, int p_26553_, boolean p_26554_, int p_26555_)
    • createPath

      @Nullable protected Path createPath(Set<BlockPos> p_148223_, int p_148224_, boolean p_148225_, int p_148226_, float p_148227_)
    • moveTo

      public boolean moveTo(double p_26520_, double p_26521_, double p_26522_, double p_26523_)
    • moveTo

      public boolean moveTo(double p_334082_, double p_333723_, double p_333873_, int p_333757_, double p_333795_)
    • moveTo

      public boolean moveTo(Entity p_26532_, double p_26533_)
    • moveTo

      public boolean moveTo(@Nullable Path p_26537_, double p_26538_)
    • getPath

      @Nullable public Path getPath()
    • tick

      public void tick()
    • getGroundY

      protected double getGroundY(Vec3 p_186132_)
    • followThePath

      protected void followThePath()
    • shouldTargetNextNodeInDirection

      private boolean shouldTargetNextNodeInDirection(Vec3 p_26560_)
    • doStuckDetection

      protected void doStuckDetection(Vec3 p_26539_)
    • timeoutPath

      private void timeoutPath()
    • resetStuckTimeout

      private void resetStuckTimeout()
    • isDone

      public boolean isDone()
    • isInProgress

      public boolean isInProgress()
    • stop

      public void stop()
    • getTempMobPos

      protected abstract Vec3 getTempMobPos()
    • canUpdatePath

      protected abstract boolean canUpdatePath()
    • trimPath

      protected void trimPath()
    • canMoveDirectly

      protected boolean canMoveDirectly(Vec3 p_186133_, Vec3 p_186134_)
    • canCutCorner

      public boolean canCutCorner(PathType p_326808_)
    • isClearForMovementBetween

      protected static boolean isClearForMovementBetween(Mob p_262599_, Vec3 p_262674_, Vec3 p_262586_, boolean p_262676_)
    • isStableDestination

      public boolean isStableDestination(BlockPos p_26545_)
    • getNodeEvaluator

      public NodeEvaluator getNodeEvaluator()
    • setCanFloat

      public void setCanFloat(boolean p_26563_)
    • canFloat

      public boolean canFloat()
    • shouldRecomputePath

      public boolean shouldRecomputePath(BlockPos p_200904_)
    • getMaxDistanceToWaypoint

      public float getMaxDistanceToWaypoint()
    • isStuck

      public boolean isStuck()