GetUnitClassId
ESO Lua API function — used by 142 of the 3,030 addons we indexed (combined 38,034,817 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.
Official signature
GetUnitClassId(string unitTag)Returns: integer classId
Real usage — from Action Duration Reminder
if l.powerLashGuideState.isDragonknight == nil then
l.powerLashGuideState.isDragonknight = GetUnitClassId("player") == models.DRAGONKNIGHT_CLASS_ID
endShort 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 |
|---|---|
| Action Duration Reminder | 6,522,011 |
| LibCombat | 5,017,654 |
| Code's Combat Alerts | 4,445,158 |
| HodorReflexes - DPS & ULT tracker | 3,446,840 |
| Item Set Browser | 1,893,031 |
| LibCharacterKnowledge | 1,771,857 |