Skip to content

Behavior Profiles and Conditions

Rifa edited this page Aug 9, 2026 · 1 revision

Behavior Profiles & Conditions

Component Class
Profile Manager net.dasik.social.api.profile.BehaviorProfileManager
Profile Interface net.dasik.social.api.profile.BehaviorProfile
Condition Interface net.dasik.social.api.profile.BehaviorCondition
Interface Marker net.dasik.social.api.profile.ProfileAware

๐ŸŽญ Overview & Dynamic Behavior State Machines

BehaviorProfileManager enables mobs to switch dynamic AI profiles based on environment conditions (e.g. night time, low health, pack leadership, or weather).

[ LivingEntity Tick ]
         โ”‚
         โ–ผ
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚    BehaviorProfileManager   โ”‚  โ—„โ”€โ”€ Evaluate Conditions
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
         โ”‚            โ”‚
         โ–ผ            โ–ผ
   [ Night Profile ] [ Combat Profile ]

๐Ÿ’ป Developer Code Example

// Create a profile using DefaultProfileBuilder
BehaviorProfile netherProfile = new DefaultProfileBuilder("nether_hunter")
    .priority(10)
    .condition(BehaviorCondition.inDimension(Level.NETHER))
    .goals(configurator -> configurator.add(2, new FollowLeaderGoal<>(mob, GroupParameters.DEFAULT_TERRESTRIAL, 16.0D)))
    .build();

// Register profile on manager instance
BehaviorProfileManager manager = new BehaviorProfileManager();
manager.registerProfile(netherProfile);

๐Ÿ”— Related Pages

Clone this wiki locally