ESODecoded

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 LibQuestDataits ESOUI page; the code belongs to its author. Shown because documentation without a working example is half a reference.

Most-downloaded addons using it

AddonTotal downloads
LibQuestData4,916,044
Urich's Skill Point Finder1,834,266
Azurah - Interface Enhanced1,462,318
Auto Category - Revised1,180,586
Lootdrop, Continued (All in One)1,145,178
Foundry Tactical Combat (FTC)1,097,601