ESODecoded

GetCompanionName

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

Official signature

GetCompanionName(integer companionId)

Returns: string name

Real usage — from Inventory Insight

  if HasActiveCompanion() then
    return ZO_CachedStrFormat(SI_UNIT_NAME, GetCompanionName(GetActiveCompanionDefId()))
    -- returns nil if no current active companion

Short excerpt from the shipping addon Inventory Insightits 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
Inventory Insight2,763,446
Info Panel368,274
Bandits Companions and Pets192,393
LootDrop Reborn192,278
SuperStar - Seasonal Update178,124
The Elder Bar Reloaded75,429