Package de.Keyle.MyPet.api.skill.skills
Interface Behavior
- All Superinterfaces:
ActiveSkill,Scheduler,Skill
Skill that controls the pet's combat behavior mode. The owner can cycle through
available modes to change how the pet reacts to nearby entities:
- Normal -- follows the owner, only attacks targets the owner hits
- Friendly -- never attacks, ignores all hostiles
- Aggressive -- attacks all nearby hostile mobs autonomously
- Raid -- attacks only mobs, never players (useful in group PvE)
- Farm -- attacks hostile mobs but stays within a set range
- Duel -- attacks other players' pets only
Which modes are available depends on the pet's skilltree level; each mode is
individually unlocked via its own UpgradeComputer<Boolean>. The
selected mode is persisted via a registered SkillStateCodec and ticks
via Scheduler to reset mode if needed.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnumerates the possible pet behavior modes.static final recordSnapshot of a Behavior skill's selected mode (persisted or live). -
Method Summary
Modifier and TypeMethodDescriptionReturns the upgrade computer controlling whether Aggressive mode is unlocked.Returns the pet's currently active behavior mode.Returns the upgrade computer controlling whether Duel mode is unlocked.Returns the upgrade computer controlling whether Farm mode is unlocked.Returns the upgrade computer controlling whether Friendly mode is unlocked.Returns the upgrade computer controlling whether Raid mode is unlocked.voidSets the pet's behavior mode.Methods inherited from interface de.Keyle.MyPet.api.skill.ActiveSkill
activateMethods inherited from interface de.Keyle.MyPet.api.skill.skilltree.Skill
applyState, getName, getName, getPet, getState, getUpgradeMessage, isActive, reset, toPrettyComponent
-
Method Details
-
getBehavior
Behavior.BehaviorMode getBehavior()Returns the pet's currently active behavior mode.- Returns:
- the behaviour mode currently selected
-
setBehavior
Sets the pet's behavior mode.- Parameters:
mode- the new behavior mode to apply
-
getFarmBehavior
UpgradeComputer<Boolean> getFarmBehavior()Returns the upgrade computer controlling whether Farm mode is unlocked.- Returns:
- the upgrade computer for whether Farm mode is unlocked
-
getRaidBehavior
UpgradeComputer<Boolean> getRaidBehavior()Returns the upgrade computer controlling whether Raid mode is unlocked.- Returns:
- the upgrade computer for whether Raid mode is unlocked
-
getDuelBehavior
UpgradeComputer<Boolean> getDuelBehavior()Returns the upgrade computer controlling whether Duel mode is unlocked.- Returns:
- the upgrade computer for whether Duel mode is unlocked
-
getAggressiveBehavior
UpgradeComputer<Boolean> getAggressiveBehavior()Returns the upgrade computer controlling whether Aggressive mode is unlocked.- Returns:
- the upgrade computer for whether Aggressive mode is unlocked
-
getFriendlyBehavior
UpgradeComputer<Boolean> getFriendlyBehavior()Returns the upgrade computer controlling whether Friendly mode is unlocked.- Returns:
- the upgrade computer for whether Friendly mode is unlocked
-