Repository navigation
AbstractModule
github-actions[bot] edited this page Mar 1, 2026
·
1 revision
org.scentient.spp.persona.module.AbstractModule
Base class for internal modules providing default implementations for enabled/active state management and cancel logic. Subclasses only need to implement id(), priority(), evaluate().
| Method | Default |
|---|---|
isEnabled() |
true |
loadConfig(JsonObject) |
No-op |
tick(PersonaEntity) |
Returns TickResult.DONE (one-shot decisions) |
cancel() |
Sets active to false
|
isActive() |
Returns current active state |
Subclasses call this to mark themselves as actively executing a multi-tick decision.
Extend AbstractModule for most modules. Only implement PersonaModule directly if you need full control over all lifecycle methods.
public class PatrolModule extends AbstractModule {
@Override
public String id() { return "patrol"; }
@Override
public ActionPriority priority() { return ActionPriority.STANDBY; }
@Override
public Optional<ActionDecision> evaluate(ModuleContext ctx) {
// Patrol logic here
return Optional.of(ActionDecision.moveTo(target, "patrol"));
}
}Marked API-SURFACE — part of the public spp-lib API.
SPP-AI Wiki
API Reference
- PersonaModule
- AbstractModule
- ActionPriority
- TickResult
- ModuleContext
- WorldSnapshot
- PersonaInventory
- ActionDecision
- BattleCapabilityProvider
Guides
Addon System