Interface ICombat


public interface ICombat
Provides access to combat-related information and actions.

This interface offers methods for managing combat state, including special attacks, health, status effects (poison, venom, antifire), auto-retaliate settings, and finding attackable NPCs.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    default INPC
    getAttackableNPC(int... ids)
    Finds an attackable NPC with any of the specified IDs.
    default INPC
    Finds an attackable NPC with any of the specified names.
    Finds an attackable NPC matching the specified filter.
    Gets the currently selected attack style.
    int
    Gets the current Soulreaper Axe stack count.
    net.runelite.api.coords.WorldPoint
    Gets the world location of the player's placed dwarf multicannon.
    int
    Gets the current hitpoints level.
    Gets the weapon style of the currently equipped weapon.
    double
    Gets the current health as a percentage of maximum health.
    int
    Gets the amount of health points currently missing.
    int
    Gets the current special attack energy percentage.
    net.runelite.api.coords.WorldPoint
    Gets the world location of the player's gravestone/tomb.
    boolean
    Checks if the player has antifire (dragonfire protection) active.
    boolean
    Checks if the player currently has antipoison protection active.
    boolean
    Checks if the player currently has antivenom protection active.
    boolean
    Checks if the player is currently poisoned.
    boolean
    Checks if auto-retaliate is currently enabled.
    boolean
    Checks if special attack is currently enabled/toggled on.
    boolean
    Checks if the player has super antifire (extended dragonfire protection) active.
    boolean
    Checks if the player is currently afflicted with venom.
    void
    Sets the attack style to the specified option.
    default void
    Toggles auto-retaliate to the opposite of its current state.
    void
    Sets auto-retaliate to the specified state.
    void
    Toggles the special attack bar.
  • Method Details

    • getSpecEnergy

      int getSpecEnergy()
      Gets the current special attack energy percentage.
      Returns:
      the special attack energy (0-100)
    • getMissingHealth

      int getMissingHealth()
      Gets the amount of health points currently missing.

      Calculated as base hitpoints level minus current boosted hitpoints. Returns 0 if at full health or overhealed.

      Returns:
      the missing health points, minimum 0
    • isVenomed

      boolean isVenomed()
      Checks if the player is currently afflicted with venom.

      Venom is a stronger form of poison that increases in damage over time.

      Returns:
      true if venomed, false otherwise
    • isPoisoned

      boolean isPoisoned()
      Checks if the player is currently poisoned.

      Note: This returns true for both poison and venom. Use isVenomed() to specifically check for venom.

      Returns:
      true if poisoned or venomed, false otherwise
    • isAntiPoisoned

      boolean isAntiPoisoned()
      Checks if the player currently has antipoison protection active.
      Returns:
      true if antipoison effect is active, false otherwise
    • isAntiVenomed

      boolean isAntiVenomed()
      Checks if the player currently has antivenom protection active.

      Antivenom provides stronger protection than regular antipoison.

      Returns:
      true if antivenom effect is active, false otherwise
    • isSpecEnabled

      boolean isSpecEnabled()
      Checks if special attack is currently enabled/toggled on.
      Returns:
      true if special attack is enabled, false otherwise
    • getAxeEnergy

      int getAxeEnergy()
      Gets the current Soulreaper Axe stack count.

      The Soulreaper Axe builds stacks that increase special attack damage but drain hitpoints.

      Returns:
      the current number of Soulreaper Axe stacks
    • isAntifired

      boolean isAntifired()
      Checks if the player has antifire (dragonfire protection) active.
      Returns:
      true if antifire is active, false otherwise
    • isSuperAntifired

      boolean isSuperAntifired()
      Checks if the player has super antifire (extended dragonfire protection) active.

      Super antifire provides complete protection against dragonfire without a shield.

      Returns:
      true if super antifire is active, false otherwise
    • isRetaliating

      boolean isRetaliating()
      Checks if auto-retaliate is currently enabled.

      When enabled, the player will automatically attack back when attacked.

      Returns:
      true if auto-retaliate is on, false otherwise
    • toggleAutoRetaliate

      default void toggleAutoRetaliate()
      Toggles auto-retaliate to the opposite of its current state.
    • toggleAutoRetaliate

      void toggleAutoRetaliate(Boolean active)
      Sets auto-retaliate to the specified state.

      If the requested state matches the current state, no action is taken.

      Parameters:
      active - true to enable auto-retaliate, false to disable
    • toggleSpec

      void toggleSpec()
      Toggles the special attack bar.

      Clicking the special attack bar will enable it for the next attack (if enough energy is available).

    • getAttackStyle

      AttackStyle getAttackStyle()
      Gets the currently selected attack style.
      Returns:
      the current attack style
    • setAttackStyle

      void setAttackStyle(AttackStyle attackStyle)
      Sets the attack style to the specified option.

      This will click the corresponding attack style button in the combat interface.

      Parameters:
      attackStyle - the attack style to select
    • getAttackableNPC

      default INPC getAttackableNPC(int... ids)
      Finds an attackable NPC with any of the specified IDs.

      An NPC is considered attackable if it has an "Attack" action, is not already being attacked by another player, and prioritizes NPCs that are already attacking the local player.

      Parameters:
      ids - the NPC IDs to search for
      Returns:
      the nearest attackable NPC matching the IDs, or null if none found
    • getAttackableNPC

      default INPC getAttackableNPC(String... names)
      Finds an attackable NPC with any of the specified names.

      An NPC is considered attackable if it has an "Attack" action, is not already being attacked by another player, and prioritizes NPCs that are already attacking the local player.

      Parameters:
      names - the NPC names to search for
      Returns:
      the nearest attackable NPC matching the names, or null if none found
    • getAttackableNPC

      INPC getAttackableNPC(Predicate<INPC> filter)
      Finds an attackable NPC matching the specified filter.

      The search prioritizes:

      1. NPCs that are attacking the local player and not being attacked by others
      2. NPCs that are not interacting with anyone and not being attacked by others

      Parameters:
      filter - the predicate to filter NPCs
      Returns:
      the nearest attackable NPC matching the filter, or null if none found
    • getCurrentHealth

      int getCurrentHealth()
      Gets the current hitpoints level.
      Returns:
      the current boosted hitpoints level
    • getHealthPercent

      double getHealthPercent()
      Gets the current health as a percentage of maximum health.
      Returns:
      the health percentage (0.0 to 100.0)
    • getTombWorldPoint

      net.runelite.api.coords.WorldPoint getTombWorldPoint()
      Gets the world location of the player's gravestone/tomb.

      Returns the location where items can be retrieved after death.

      Returns:
      the gravestone location, or null if no active gravestone exists
    • getCannonWorldPoint

      net.runelite.api.coords.WorldPoint getCannonWorldPoint()
      Gets the world location of the player's placed dwarf multicannon.
      Returns:
      the cannon location, or null if no cannon is placed
    • getCurrentWeaponStyle

      WeaponStyle getCurrentWeaponStyle()
      Gets the weapon style of the currently equipped weapon.

      Returns the combat style category (melee, ranged, magic) based on the weapon in the weapon equipment slot.

      Returns:
      the current weapon style, defaults to MELEE if no weapon equipped