Interface Behavior

All Superinterfaces:
ActiveSkill, Scheduler, Skill

public interface Behavior extends Skill, Scheduler, ActiveSkill
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:
  • Method Details

    • getBehavior

      Behavior.BehaviorMode getBehavior()
      Returns the pet's currently active behavior mode.
      Returns:
      the behaviour mode currently selected
    • setBehavior

      void setBehavior(Behavior.BehaviorMode mode)
      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