IsUnitInCombat
ESO Lua API function — used by 413 of the 3,030 addons we indexed (combined 56,119,121 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.
Official signature
IsUnitInCombat(string unitTag)Returns: bool isInCombat
Real usage — from Action Duration Reminder
EVENT_MANAGER:RegisterForEvent(addon.name.."_ChatAlert", EVENT_PLAYER_COMBAT_STATE, l.onPlayerCombatState)
l.inCombat = IsUnitInCombat('player')
l.showWelcomePrompt()Short excerpt from the shipping addon Action Duration Reminder — its ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.
Most-downloaded addons using it
| Addon | Total downloads |
|---|---|
| Map Pins | 8,061,548 |
| Action Duration Reminder | 6,522,011 |
| Code's Combat Alerts | 4,445,158 |
| Votan's Minimap | 4,211,718 |
| HodorReflexes - DPS & ULT tracker | 3,446,840 |
| LibMapPing | 2,827,802 |