wowkit API
    Preparing search index...

    Class UnitsService

    Index
    • Hostile and attackable (nameplates); a hidden answer counts as no.

      Parameters

      • unit: UnitToken

      Returns boolean

    • Parameters

      • unit: UnitToken

      Returns boolean

    • "normal", "elite", "rareelite", "worldboss", ...; undefined when hidden.

      Parameters

      • unit: UnitToken

      Returns string | undefined

    • The creature type in lower case ("undead", "mechanical"); undefined when the client hides it.

      Parameters

      • unit: UnitToken

      Returns string | undefined

    • The unit's GUID; undefined when the client hides it (an NPC's GUID is secret on restricted maps).

      Parameters

      • unit: UnitToken

      Returns string | undefined

    • Health in percent; undefined when the client hides it.

      Parameters

      • unit: UnitToken

      Returns number | undefined

    • Parameters

      • unit: UnitToken

      Returns number | undefined

    • Parameters

      • unit: UnitToken

      Returns number | undefined

    • How far the unit is, as a band of yards: [nearest, farthest]. From the client's measure for group members, else from the interact distances (in combat the client refuses these for a friendly unit). Undefined ends are unknown.

      Parameters

      • unit: UnitToken

      Returns LuaMultiReturn<[nearest: number, farthest: number]>

    • How the unit stands to the player: 1 hated ... 4 neutral ... 8 exalted; undefined when the client hides it.

      Parameters

      • unit: UnitToken

      Returns number | undefined

    • The threat state of the player on the unit (2 or 3: the player has aggro); undefined when hidden or not on the table.

      Parameters

      • unit: UnitToken

      Returns number | undefined

    • Dead; undefined when the client hides it.

      Parameters

      • unit: UnitToken

      Returns boolean | undefined

    • Parameters

      • unit: UnitToken

      Returns boolean

    • A living unit the player cannot attack and that is friendly to them.

      Parameters

      • unit: UnitToken

      Returns boolean

    • In combat; undefined when the client hides it.

      Parameters

      • unit: UnitToken

      Returns boolean | undefined

    • Is the unit on the player's threat table at all? Undefined when the client hides it.

      Parameters

      • unit: UnitToken

      Returns boolean | undefined

    • Parameters

      • unit: UnitToken

      Returns boolean

    • Are the two tokens the same unit? Undefined when the client hides it (compound tokens in combat).

      Parameters

      • unit: UnitToken
      • other: UnitToken

      Returns boolean | undefined

    • Within the duel distance (about 10 yards); undefined when unknown.

      Parameters

      • unit: UnitToken

      Returns boolean | undefined

    • Within the inspect distance (about 28 yards); undefined when unknown.

      Parameters

      • unit: UnitToken

      Returns boolean | undefined

    • The unit is casting or channeling; a readable "not interruptible" marks the cast shielded.

      Parameters

      • unit: UnitToken

      Returns UnitCast

    • The unit's power of a kind (0 mana, 1 rage, 3 energy): current and maximum; undefined when hidden.

      Parameters

      • unit: UnitToken
      • powerType: number

      Returns { current: number; max: number } | undefined