COWMODSКаталог модов

A* Pathfinding

Minecraft Pathfinder for Entities

Автор: CJDev2,8 тыс.17обновлён 1 сент. 2026 г.
БиблиотекиМобыОптимизация

Описание

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 <maxDistance> — default: 100 (10 blocks) — max distance the pathfinder may travel till finalizing the path.
scoreboard players set maxStepHeight astar.config <maxStepHeight> — default: 1 — how many blocks it may walk up at once.
scoreboard players set maxFallDistance astar.config -<maxFallDistance> — default: -3 — negative value, how many blocks it may fall each step.
To avoid conflicts with others' usage, run function astar:default_config or scoreboard 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 <any> results in only impassable being effective
— impassable via kill @s — add/remove cost via scoreboard players add/remove @s astar.f <amount>

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

Галерея

Visualization

Последние версии

Все версии →
beta

A* Pathfinding 0.7.3

0.7.3+mod
1 сент. 2026 г.225Minecraft: 26.3-pre-1, 26.3-pre-2, 26.3-pre-3, 26.3-rc-1, 26.3-rc-2, 26.3, 26.4-snapshot-1, 26.4-snapshot-2, 26.4-snapshot-3, 26.4-snapshot-4, 26.4-snapshot-5fabric, forge, neoforge, quilt
Скачать
Что нового
bump version\ better performance due to new number providers
beta

A* Pathfinding 0.7.3

0.7.3
1 сент. 2026 г.64Minecraft: 26.3-pre-1, 26.3-pre-2, 26.3-pre-3, 26.3-rc-1, 26.3-rc-2, 26.3, 26.4-snapshot-1, 26.4-snapshot-2, 26.4-snapshot-3, 26.4-snapshot-4, 26.4-snapshot-5datapack
Скачать
Что нового
bump version\ better performance due to new number providers
beta

A* Pathfinding 0.7.2

0.7.2+mod
26 авг. 2026 г.44Minecraft: 26.3-snapshot-10fabric, forge, neoforge, quilt
Скачать
Что нового
bump version
beta

A* Pathfinding 0.7.2

0.7.2
26 авг. 2026 г.36Minecraft: 26.3-snapshot-10datapack
Скачать
Что нового
bump version
beta

A* Pathfinding 0.7.1

0.7.1+mod
16 апр. 2026 г.605Minecraft: 1.21-pre1, 1.21-pre2, 1.21-pre3, 1.21-pre4, 1.21-rc1, 1.21, 1.21.1, 24w33a, 24w34a, 24w35a, 24w36a, 24w37a, 24w38a, 24w39a, 24w40a, 1.21.2-pre1, 1.21.2-pre2, 1.21.2, 1.21.3, 24w44a, 24w45a, 24w46a, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2, 26.2-snapshot-2, 26.2-snapshot-3, 26.2-snapshot-4, 26.2-snapshot-5, 26.2-snapshot-6, 26.2-snapshot-7, 26.2-snapshot-8, 26.2-pre-1, 26.2-pre-2, 26.2-pre-3, 26.2-pre-4, 26.2-pre-5, 26.2-pre-6, 26.2-rc-1, 26.2-rc-2, 26.2, 26.3-snapshot-1, 26.3-snapshot-2, 26.3-snapshot-3fabric, forge, neoforge, quilt
Скачать
Что нового
##### https://github.com/CJDevZ/A-Star-Pathfinding/commit/80b36d5dead8bc32e0023e8bd82934787c1c136d
beta

A* Pathfinding 0.7.1

0.7.1
16 апр. 2026 г.123Minecraft: 1.21-pre1, 1.21-pre2, 1.21-pre3, 1.21-pre4, 1.21-rc1, 1.21, 1.21.1, 24w33a, 24w34a, 24w35a, 24w36a, 24w37a, 24w38a, 24w39a, 24w40a, 1.21.2-pre1, 1.21.2-pre2, 1.21.2, 1.21.3, 24w44a, 24w45a, 24w46a, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1, 26.1.1, 26.1.2, 26.2-snapshot-2, 26.2-snapshot-3, 26.2-snapshot-4, 26.2-snapshot-5, 26.2-snapshot-6, 26.2-snapshot-7, 26.2-snapshot-8, 26.2-pre-1, 26.2-pre-2, 26.2-pre-3, 26.2-pre-4, 26.2-pre-5, 26.2-pre-6, 26.2-rc-1, 26.2-rc-2, 26.2, 26.3-snapshot-1, 26.3-snapshot-2, 26.3-snapshot-3datapack
Скачать
Что нового
##### https://github.com/CJDevZ/A-Star-Pathfinding/commit/80b36d5dead8bc32e0023e8bd82934787c1c136d
beta

1.21.x+

0.6.4+mod
16 дек. 2025 г.316Minecraft: 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1-snapshot-1, 26.1-snapshot-2, 26.1-snapshot-3, 26.1-snapshot-4, 26.1-snapshot-5, 26.1-snapshot-6, 26.1-snapshot-7, 26.1-snapshot-8, 26.1-snapshot-9, 26.1-snapshot-10, 26.1-snapshot-11, 26.1-pre-1, 26.1, 26.1.1, 26.1.2, 26.2-snapshot-2fabric, forge, neoforge, quilt
Скачать
Что нового
- Fixed not being recognized in 26.1-snapshot-1 and later
beta

1.21.x+

0.6.4
16 дек. 2025 г.89Minecraft: 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11, 26.1-snapshot-1, 26.1-snapshot-2, 26.1-snapshot-3, 26.1-snapshot-4, 26.1-snapshot-5, 26.1-snapshot-6, 26.1-snapshot-7, 26.1-snapshot-8, 26.1-snapshot-9, 26.1-snapshot-10, 26.1-snapshot-11, 26.1-pre-1, 26.1, 26.1.1, 26.1.2, 26.2-snapshot-2datapack
Скачать
Что нового
- Fixed not being recognized in 26.1-snapshot-1 and later
beta

1.21.x+

0.6.3+mod
29 сент. 2025 г.193Minecraft: 24w21a, 24w21b, 1.21-pre1, 1.21-pre2, 1.21-pre3, 1.21-pre4, 1.21-rc1, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 25w31a, 25w32a, 25w33a, 25w34a, 25w34b, 25w35a, 25w36a, 25w36b, 25w37a, 1.21.9-pre1, 1.21.9-pre2, 1.21.9-pre3, 1.21.9-pre4, 1.21.9-rc1, 1.21.9, 1.21.10, 1.21.11fabric, forge, neoforge, quilt
Скачать
Что нового
- Fixed Penalty Values - Fixed Pathfinder searching forever when starting in/on ladder ##### https://github.com/CJDevZ/A-Star-Pathfinding/commit/906887fb82de7cef7779892a3e3b6dfece8d75fe
beta

1.21.x+

0.6.3
29 сент. 2025 г.81Minecraft: 24w21a, 24w21b, 1.21-pre1, 1.21-pre2, 1.21-pre3, 1.21-pre4, 1.21-rc1, 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 25w31a, 25w32a, 25w33a, 25w34a, 25w34b, 25w35a, 25w36a, 25w36b, 25w37a, 1.21.9-pre1, 1.21.9-pre2, 1.21.9-pre3, 1.21.9-pre4, 1.21.9-rc1, 1.21.9, 1.21.10, 1.21.11datapack
Скачать
Что нового
- Fixed Penalty Values - Fixed Pathfinder searching forever when starting in/on ladder ##### https://github.com/CJDevZ/A-Star-Pathfinding/commit/906887fb82de7cef7779892a3e3b6dfece8d75fe