WoW API < UnitHealth

Returns the current health of the specified unit.

local health = UnitHealth(unit);

Parameters[edit | edit source]

UnitId - identifies the unit to query health for

Returns[edit | edit source]

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

Example[edit | edit source]

Print the target's health to the chat frame:

DEFAULT_CHAT_FRAME:AddMessage( "target health ="..UnitHealth("target") )
Community content is available under CC-BY-SA unless otherwise noted.