ESODecoded

IsUnitInDungeon

ESO Lua API function — used by 77 of the 3,030 addons we indexed (combined 4,383,990 downloads). Signature from the official ESOUIDocumentation.txt, API version 101050.

Official signature

IsUnitInDungeon(string unitTag)

Returns: bool isInDungeon

Real usage — from LibZone

    if not isInAnyDungeon then
        isInAnyDungeon = (IsUnitInDungeon(playerVar) or GetMapContentType() == MAP_CONTENT_DUNGEON) or false
    end

Short excerpt from the shipping addon LibZoneits 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
LibZone1,937,031
Wizard's Wardrobe481,038
Info Panel368,274
LibWorldEvents248,148
Jack of all Trades - Automatic CP Respec194,328
Thief Tools119,252