Fandom

WoWWiki

API UnitHealthMax

104,631pages on
this wiki
Add New Page
Talk0 Share

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.

WoW API < UnitHealthMax

Returns the maximum health of the specified unit.

local max_health = UnitHealthMax(unit);

ParametersEdit

unit 
UnitId - the unit whose max health to query.

ReturnsEdit

max_health 
Integer - the maximum health of the specified unit, returns 0 if the specified unit does not exist (eg. "target" given but there is no target)

ExampleEdit

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");

Also on Fandom

Random Wiki