GetUnitLevel
ESO Lua API function — used by 101 of the 3,030 addons we indexed (combined 17,547,414 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.
Official signature
GetUnitLevel(string unitTag)Returns: integer level
Real usage — from LibQuestData
if lib:is_companion_rapport_quest(questId) then showCompanionQuest = internal:check_companion_rapport_requirements(questId) end
local showCertificationQuest = GetUnitLevel("player") >= 6 and lib.quest_certifications[questId]
Short excerpt from the shipping addon LibQuestData — 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 |
|---|---|
| LibQuestData | 4,916,044 |
| Urich's Skill Point Finder | 1,834,266 |
| Azurah - Interface Enhanced | 1,462,318 |
| Auto Category - Revised | 1,180,586 |
| Lootdrop, Continued (All in One) | 1,145,178 |
| Foundry Tactical Combat (FTC) | 1,097,601 |