Mod
A* Pathfinding
No reviews yet
Minecraft Pathfinder for Entities
Data Packs were introduced to vanilla Minecraft in version 1.13 and allow the server to modify data about the game, or run commands. Data Packs are compatible with all mod loaders.
Forge is a popular mod loader for versions 1.1+ of Minecraft.
Neoforge is a fork of the Minecraft Forge available for versions 1.20.1+ of Minecraft. Many Forge mods are compatible with Neoforge and vice versa.
Fabric is a mod loader for versions 1.14+ of Minecraft, particularly popular for client side and optimization mods.
Quilt is a fork of the Fabric mod loader. Many Fabric mods are compatible with Quilt and vice versa.
Community voices
Reviews
Click once to include, again to exclude, again to clear
No reviews yet. Be the first to review this project!
Get it on
Available Platforms
Compatibility
Supported Environments
About
Project Details
For authors
Embed Badge
If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.
Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.
Identifiers
Platform IDs
About
Description
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
Versions
Files
Relations
Project Relations
More like this
Similar Mods
Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.
On ModDex
Community snapshot
By the numbers
Statistics
Want to reach Minecraft players?
We're looking for a server hosting partner to feature here and other parts of the site. Interested? Send us a message!
Get in touchGet it on
Available Platforms
On ModDex
Community snapshot
By the numbers