Class PathFinder

java.lang.Object
net.minecraft.world.level.pathfinder.PathFinder

public class PathFinder extends Object
  • Field Details

  • Constructor Details

    • PathFinder

      public PathFinder(NodeEvaluator nodeEvaluator, int maxVisitedNodes)
  • Method Details

    • setMaxVisitedNodes

      public void setMaxVisitedNodes(int maxVisitedNodes)
    • findPath

      @Nullable public Path findPath(PathNavigationRegion region, Mob mob, Set<BlockPos> targetPositions, float maxRange, int accuracy, float searchDepthMultiplier)
      Finds a path to one of the specified positions and post-processes it or returns null if no path could be found within given accuracy
    • findPath

      @Nullable private Path findPath(Node node, Map<Target,BlockPos> targetPositions, float maxRange, int accuracy, float searchDepthMultiplier)
      Finds a path to one of the specified positions and post-processes it or returns null if no path could be found within given accuracy
    • distance

      protected float distance(Node first, Node second)
    • getBestH

      private float getBestH(Node node, Set<Target> targets)
    • reconstructPath

      private Path reconstructPath(Node point, BlockPos targetPos, boolean reachesTarget)
      Converts a recursive path point structure into a path