UnitHealth

From Warcraft Wiki
Jump to navigation Jump to search

Returns the current health of the unit.

health = UnitHealth(unit [, usePredicted])

Arguments

unit
string : UnitToken
usePredicted
boolean? = true

Returns

health
number - Returns 0 if the unit is dead or does not exist.

Details

Related Events UNIT_HEALTH
Available after PLAYER_ENTERING_WORLD (on login)

Patch changes

Retail

Wrath-Logo-Small.png Patch 3.0.2 (2008-10-14): Returns absolute health instead of percentages for non party/raid units.

Classic

WoW Icon update.png Patch 1.13.3 (2019-12-10): Returns absolute health values for NPCs to alleviate addon comms load from the Real Mob Health addon. Still returns health percentages for players. (Hotfix during build 33302, Feb 7 2020) [1]
WoW Icon update.png Patch 1.13.2 (2019-08-26): Added. Shows health percentages for non party/raid units.

References

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