From Wowpedia
Jump to: navigation, search

Returns the maximum health of the specified unit; however, this function behaves differently between Retail and Classic.

local max_health = UnitHealthMax(unit);


UnitId - the unit whose max health to query.


Integer - the maximum health of the specified unit; however, returns 0 if the specified unit does not exist (eg. "target" when there is no target) and returns 100 in Classic for units not in the same party or raid


Print the maximum health of player and target units to the chat window:

ChatFrame1:AddMessage('Player max health: ' .. UnitHealthMax("player") .. " HP");
ChatFrame1:AddMessage('Target max health: ' .. UnitHealthMax("target") .. " HP");

See Also

Patch changes


  • Wrath of the Lich King Patch 3.0.2 / API changes (2008-10-14): Units outside your own party or raid now show genuine maximum health (not just 100)


  • WoW Icon update.png Patch 1.13.3 / API changes (2019-12-10): Changed to return real health values for NPCs in order to alleviate addon comms load from the Real Mob Health addon.
    Still returns health percentages when used on players. (Hotfix during build 33302, Feb 7 2020) [1]
  • WoW Icon update.png Patch 1.13.2 / API changes (2019-08-26): Versus 8.0.1, UnitHealthMax returns to older behaviour showing 100 for units outside your party or raid


  1. ^ Kaivax 2020-02-18. UI API Change for UnitHealth.