Logo
MINECRAFTBIBLE
Items
Items

All game items

Blocks
Blocks

Building blocks

Mobs
Mobs

Creatures & monsters

Biomes
Biomes

World biomes

Structures
Structures

Generated structures

Recipes
Recipes

Crafting guides

Advancements
Advancements

Achievements

Loot Tables
Loot Tables

Drop rates

Tags
Tags

Item groupings

All Versions
View all data →
Capes
Cape ArchiveNEW

Browse rare Minecon capes, OptiFine capes, and custom capes from players worldwide

Browse

Player Database
Player DatabasePopular

Search any player

Skin Browser
Skin Browser

Browse & download skins

Cape Gallery
Cape GalleryNEW

Minecon & OptiFine capes

Seed Vault
Seed Vault

Curated seeds

Learn

Guides
GuidesNew

Tutorials & tips

Blog
Blog

News & updates

Community

Community Hub
Community HubHub

Posts, discussions & more

All Versions
View community →
Seed Analyzer
Seed Analyzer

World seed analysis

Loot Explorer
Loot Explorer

Drop rates

Crafting Calculator
Crafting Calculator

Material planning

Enchant Calculator
Enchant Calculator

Probability math

Redstone Lab
Redstone Lab

Signal timing

Trading Profit
Trading Profit

Villager ROI

All Versions
View all tools →
Mods
Mods

Browse all mods

Plugins
Plugins

Server plugins

Resource Packs
Resource Packs

Textures & sounds

Shaders
Shaders

Visual enhancements

Datapacks
Datapacks

World logic

Scanner
Mod Intelligence

Scan & analyze any mod

All Versions
View all mods →
Loading...
IntroductionIntroductionVersion HistoryVersion HistoryGuidesGuidesBlog & NewsBlog & News
ItemsItemsBlocksBlocksMobsMobsRecipesRecipesBiomesBiomesStructuresStructuresAdvancementsAdvancementsLoot TablesLoot TablesTagsTags
ModsModsPluginsPluginsResource PacksResource PacksShadersShadersDatapacksDatapacks

MinecraftBible

The Ultimate Wiki

Logo
MINECRAFTBIBLE

The ultimate Minecraft reference. Every item, block, mob, and recipe documented with precision.

Community

  • Skin Browser
  • Cape Gallery
  • Seed Vault
  • Blog
  • Guides

Database

  • Items
  • Blocks
  • Mobs
  • Recipes
  • Biomes
  • Structures

Tools

  • Seed Analyzer
  • Mod Intelligence
  • Crafting Calculator
  • Enchant Calculator

Mods & Packs

  • Mods
  • Plugins
  • Resource Packs
  • Shaders
  • Datapacks

Site & Legal

  • About
  • Authors
  • Editorial Policy
  • Corrections
  • Contact
  • Privacy Policy
  • Terms of Service
  • DMCA
  • Sitemap

© 2026 MinecraftBible. Not affiliated with Mojang or Microsoft.

PrivacyTermsContact
AI Pathfinder
ModGPL-3.0-only

AI Pathfinder

Implements Pathfinding for your Custom Mob!

157
Downloads
7
Followers
3 months ago
Updated
📦
6
Versions
librarymobsdatapackfabricforgeneoforgequilt
Download Latestv1.1.0+modView on Modrinth

📖About AI Pathfinder

AI Pathfinder Title Card


AI Pathfinder

  • Force a Custom Entity to Pathfind to a Fixed Position in the World! (useful for mapmaking)
  • Force Entities to Chase Other Entities!
  • Supported versions: 1.21.2+

AI Pathfinder datapack allows you to directly plug smart pathfinding to your custom Mob/Monster/NPC for MapMaking or MiniGame purposes. This datapack does all the heavy lifting of the AI for you — Gone are the days of Retexturing Entities!


Credits

CJDev's Credits :3

This datapack is built upon CJDev's A* Pathfinding datapack!


How to Use?

  • First, choose your base entity.

This entity will be the body of your custom entity. This entity may also be the hitbox of your entity, if you decide to not implement a custom hitbox system. If you are on Minecraft Version 1.21.9+, we recommend you choose a Mannequin Entity as your base entity.

  • Second, link your entity with your custom entity display.

Depending on your implementation, link your "custom entity display" with this base entity. This could be something as simple as a static model or as complicated as an Animated-Java Rig. Linking can be done via an ID system that the datapack inherently doesn't provide.

  • Thirdly, give your entity the ai.pathfinding tag

Using the /tag command, give your entity the ai.pathfinding tag:

/tag <entity> add ai.pathfinding

Once this tag is added, this datapack will initialize some base values for the AI. Values like the MovementSpeed of the AI, the State of the AI, the JumpStrength, the Reach, it's View Range and View Cone.

There you have it! An Entity with custom AI that is willing to listen to your commands!
Now, for the big list of customizable things:


Modifyable Values


Scoreboards

ai.State: It stores the State of the AI.
                          |__________ Idle = 0;
                          |__________ Walking = 1;
                          |__________ Sprinting = 2;

ai.Mode: It stores the "Mode" of the AI.
                          |__________ Idle = 0;
                          |__________ Roaming Only = 1;
                          |__________ Chasing Target Entity = 2;

Time Values:
ai.PathfindingDuration: It stores how long the AI waits before creating another path. This value ticks down when a Path is Generated.
ai.ChasingEntityMemoryDuration: It stores the value of how long the AI can remember an entity until it forgets.
ai.baseLostEntityGracePeriod: The amount of time the AI waits after it has lost the target entity, before it begins to pathfind.

AI Values:
ai.baseMovementSpeed: It stores the Custom Value for Movement Speed of the AI (it changes depending on the value of ai.State) (x1000)
ai.baseSprintSpeed: It stores the Custom Value for Movement Speed of the AI (it changes depending on the value of ai.State) (x1000)
ai.baseJumpStrength: It stores the Custom Value for Jump Strength of the AI. (x1000)
ai.baseViewAngle: It stores the half angle of the View Cone of the AI (x1000)
ai.baseViewRange: It stores the Radius of the Half Angle of View Cone (x1000)

Setting the score of the AI on a scoreboard with a name with the ai.base... prefix is optional. Not setting them will result in the datapack using the base values assigned below. These base values can be modified as well, as they're stored in the ai.Values scoreboard.

Base Values

These values are initialized in ai:global/load and are scaled (x1000)

baseMovementSpeed = 150
baseSprintSpeed = 220
baseJumpStrength = 410
baseViewHalfAngle = 30000 // 60° Cone.
baseLostEntityGracePeriod = 200 // AI stands still for 10 seconds before it starts moving again.

// These values are scaled (x10) since they're used in raycasting.
baseViewRange = 300 // AI can see up to 30 blocks away (view cone radius is 30 blocks)

By Modifying these values, you can tune the AI to meet your needs!


Additional Examples:

  • Say you wanted to make it so that your base entity only runs when you want it to. To make it run from one location to another, set its ai.State score to 2. If you want it to only walk everywhere, set its ai.State score to 1.
  • Say you want your AI entity to only roam but not chase any entity. Set its ai.Mode to 1.

Now, the API that the datapack provides:

API

"ai:api/pathfind"
Usage: execute as <ai> at <location_marker_entity> run function ai:api/pathfind
Once this function is ran, the AI will formulate a path towards the position of <location_marker_entity>. Once the path is formed, it will begin travelling through it.


"ai:api/set_mode/chasing"
Usage: execute as <ai> at @s as <target_entity> run function ai:api/set_mode/chasing
Once this function is ran, <target_entity> will begin to be targetted by the AI. If <target_entity> appears in the View Cone of the AI, whose dimensions are specified by the ai.ViewRange and ai.ViewAngle scoreboards, the AI will start chasing <target_entity>.


"ai:api/set_mode/idle"
Usage: execute as <ai> run function ai:api/set_mode/idle
This function stops the AI from implementing pathfinding logic. Useful if you want to play an Animation.

"ai:api/set_mode/roaming"
Usage: execute as <ai> run function ai:api/set_mode/roaming
Once this function is ran, the AI will become passive. Alternatively, if there are entities of type #ai:node (by default, it only contains marker) and tag "ai.Node", the AI will randomly pathfind to this entity after random intervals of time.

Tags

Some Special Tags the AI Entity can have that Modify its behavior:

ai.CompletePathBeforeUpdating = There's a possibility that the AI may change path before reaching its destination first. This tag will prevent that from happening.

ai.LookOnlyAtPath = While Moving, The AI will only look at the Path it's travelling.

ai.RandomlyLookAnywhere = While Moving, The AI will Randomly Look either at a Random Yaw, Pitch, or at an interesting nearby entity, meant to heighten Realism and its Life.

ai.Node = Any Entity of Type #ai:node with this tag will act as Node that the entity can travel to while Roaming Around. Useful for fixing Locations.

ai.BeingTargetted = If an Entity with this tag and with the same score as the AI entity in scoreboard ai:id, enters the AI's view cone, the AI will start chasing it IF it's ai.Mode is set to 2 (Chase Mode)

Examples


Recreating the Minecraft Player with Mannequins!


👥 Team & Contributors

barden
bardenOwner
CJDev
CJDev
contributor

⚙️ Compatibility

Environment
🖥️ Server-side
Loaders
datapackfabricforgeneoforgequilt
Minecraft Versions
1.21.21.21.31.21.41.21.51.21.61.21.71.21.81.21.9+2 more

🔗 Links

Modrinth Page