Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 1.29 KB

README.md

File metadata and controls

44 lines (34 loc) · 1.29 KB

A WIP PocketMine Pathfinder

Features:

  • AStar pathfinding
  • Pathfinding can be divided into several ticks
  • Set costs for various blocks
  • Navigator for entities

API:

Finding a path between two points:

  1. Create an AStar-Object
$aStar = new AStar(World $world, Vector3 $startVector3, Vector3 $targetVector3, ?AxisAlignedBB $axisAlignedBB);
  1. Configure settings (See Algorithm-Class for all available methods)
$aStar->setTimeout(float $timeout);
$aStar->setJumpHeight(int $jumpHeight);
...
  1. Start and get pathfinding result
$aStar->then(function(?PathResult $pathResult): void {
    if($pathResult === null) {
        echo "No path found!";
        return;
    }
    echo "Path found!";
})->start();

Important:

This pathfinder is not the best, but you can help to improve it. If you see code places that can be improved or any method/variable names that don't fit, please create a pull request with the respective changes.

Thanks!

Contact me:

Twitter
Discord: Matze#1754