
Sentience
An AI library for Fabric mods: give any mob real senses, a memory, and believable reactions.
Inspired by Unreal Engine's AI tools, Sentience lets mod developers attach an agent to any mob β their own, a vanilla mob, or another mod's β with realistic perception, memory, a Blackboard and alert levels, plus ready-to-use behaviours.
A creature using Sentience never knows your exact position. It hears a noise, guesses where it came from, goes to check, searches, tracks you... and can be wrong.
Players: Sentience is a library. You only need it if another mod requires it.
Features
- π Physical hearing β every game sound is captured and propagated with distance falloff, walls, block materials, and background noise (rain, water, lava) that can mask your steps. Players' voices are heard too, through Simple Voice Chat.
- π Believable sight β vision cone and blurry peripheral vision, darkness, sneaking, invisibility, camouflage, see-through glass, and a progressive detection meter like in stealth games.
- π Smell β players leave a scent trail that water breaks and rain washes away. Blood attracts. Trackers follow the trail step by step.
- β Pain & touch β being hit or brushed against reveals where you are.
- π£ Communication β agents share what they know with their allies.
- π§ Memory & alert levels β perceptions are fused, uncertain and forgotten over time; idle β suspicious β investigate β hunt.
- π Per-mod rules β each mod tunes the physics of perception for its own creatures, without ever affecting other mods.
- π§© Extensible β custom senses, components, noises, scents and stealth modifiers.
- β‘ Lightweight β automatic level of detail: far-away agents think less often, expensive checks only run when needed.
- π§ Debug view β
/sentience debugshows what every creature thinks, where it believes you are, and the scent trails around you.
For developers
Agent.builder(this)
.hearing(HearingProfile.KEEN) // hearing + voice chat
.sight(SightConfig.nocturnal()) // sight
.scent(ScentSense.hound()) // smell
.damage().touch() // pain, touch
.awareness(AwarenessProfile.DEFAULT) // suspicious β investigate β hunt
.defaultGoals(2, 0.9, 1.4) // listen, investigate, search, chase
.build();
Give a vanilla mob senses without touching its code:
AgentTemplates.register(EntityType.ZOMBIE, agent -> agent
.hearing(HearingProfile.DEFAULT)
.sight(SightConfig.humanoid())
.defaultGoals(3, 1.0, 1.2));
π Documentation: https://ananasloll3.github.io/Sentience/
π» Source code & demo mod: https://github.com/Ananasloll3/Sentience
π¦ Gradle: see the installation guide (Cursemaven / Modrinth Maven)
The GitHub repository also contains a demo mod with four creatures (each built around one sense) and a test map with an arena for each of them.
Requirements
- Minecraft 1.21.10
- Fabric Loader 0.17.3+
- Fabric API
- Optional: Simple Voice Chat (players' voices become noises)
License
MIT β use it in your mods, open source or not.