Skip to content

Behavior Profiles & Conditions

ComponentClass
Profile Managernet.dasik.social.api.profile.BehaviorProfileManager
Profile Interfacenet.dasik.social.api.profile.BehaviorProfile
Condition Interfacenet.dasik.social.api.profile.BehaviorCondition
Interface Markernet.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).

ascii
[ LivingEntity Tick ]


┌─────────────────────────────┐
│    BehaviorProfileManager   │  ◄── Evaluate Conditions
└────────┬────────────┬───────┘
         │            │
         ▼            ▼
   [ Night Profile ] [ Combat Profile ]

💻 Developer Code Example

java
// 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);

Official documentation & web portal for Dasik Igaijinn mods.