Skip to content

A* Pathfinding

Minecraft Pathfinder for Entities

FabricNeoForgeForgeQuilt
Loaders
FabricNeoForgeForgeQuilt
Downloads on Modrinth
2.9K
Followers on Modrinth
17
versions
32
Updated
September 1, 2026Sep 1
Published
in 2025
This is a library — other mods need it, and it adds nothing to the game by itselfRequired by 1 mods. Download it if another mod needs it.
Visualization · swipe

At a glance

A library: other mods need it — required by 1 mods
Runs on Fabric, NeoForge, Forge and Quilt
For Minecraft 1.21–26.3
Needed on the server; optional in the game
Latest version — 0.7.3+mod from September 1, 2026
License GPL-3.0-only — free
Where it's needed
In gameoptionalOn serverrequired

Needed on the server; optional in the game

Game versions1.21–26.3

Please also contribute to this project. I don't have infinite time on my hands 🥺

✅ Features

  • Function to find the path to a destination

📖 Usage

Call the astar:_ function and use the remaining markers tagged astar to guide anything
The starting position of the path will be located at the current entity, with the end position being the current position in the context
E.g. execute as @s at @p[distance=1..] run function astar:_
Note that floating destinations & unreached targets will result in failure

I recommend setting the maxCommandChainLength gamerule high enough for your terrain, or restrict the path to a maximum of ~10 blocks — otherwise, temporary markers may stay once the limit is reached

Config

The configuration is stored in the astar.config scoreboard objective.
`scoreboard players set maxDistance astar.config — **default: 100 (10 blocks)** — max distance the pathfinder may travel till finalizing the path.\ scoreboard players set maxStepHeight astar.config — **default: 1** — how many blocks it may walk up at once.\ scoreboard players set maxFallDistance astar.config -— **default: -3** — **negative value**, how many blocks it may fall each step.\ To avoid conflicts with others' usage, runfunction astar:default_configorscoreboard players reset * astar.config` before your logic

Block Tags

#astar:climbable — climbable
#astar:obstructs_floor — traversable, no descent
#astar:impassable_floor — impassable floor
#astar:impassable_wall — impassable wall

Penalty Block Tags

#astar:penalty/damage 160 — nearby
#astar:penalty/danger 80 — nearby
#astar:penalty/disliked 80

You may add a function to the #astar:eval_node tag to modify costs — `return results in onlyimpassablebeing effective\ — impassable viakill @s— add/remove cost viascoreboard players add/remove @s astar.f `

Penalties increase the cost of a path segment, so the algorithm prefers other routes.

Example code

#code:loop.mcfunction:

data modify storage code:pathfinding points append from entity @s Pos
kill @s
execute as @n[type=marker,tag=astar] at @s run function code:loop


#code:main.mcfunction:

execute store success score found my_score at @n[tag=target] if function astar:_ as @n[type=marker,tag=astar,sort=furthest] at @s run function code:loop
execute unless score found my_score matches 1 run function code:set_direct_target # Walk directly towards target if no path is found

FAQ

How to install A* Pathfinding?

Install Fabric for your Minecraft version, download A* Pathfinding for the same version and loader, put the file into the mods folder and launch the game with the loader profile.

Which Minecraft versions does A* Pathfinding support?

A* Pathfinding has builds for Minecraft 1.21–26.3.

Is A* Pathfinding needed on the server?

Needed on the server; optional in the game

License and source
GNU General Public License v3.0 onlyfree to use and share; changes to the mod itself must be published under the same license
Original — Modrinth↗Files unchanged, verified with SHA-512Is this your mod? For rights holders

The site uses cookies: the necessary ones for sign-in and the theme, plus the Yandex Metrica and LiveInternet visit counters — they show us how the site is used. We have no advertising cookies. More