Jump to content
Toggle menu
  • 17.3K articles
  • 8.2K files
  • 5 users
  • 280.7K edits
WoW Classic Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
UnitHealth -Documentation by danboo-

Returns the current health of the specified unit, in percentage, for:

  • target
  • mouseover
  • pet if pet is charmed/enslaved

Otherwise in points.

local health = UnitHealth(unit);

Arguments
(String unit)
arg1
the unit's health to query

Returns
health
health
the current health of the specified unit

Example
local health = UnitHealth("player");
local health2 = UnitHealth("target");
ChatFrame1:AddMessage('player health: ' .. health);
ChatFrame1:AddMessage('target health2: ' .. health .. "%");
Result
Prints the player's and target's health to the chat frame as

'player health: 900' and 'target health: 80%'.

Description
Returns the current health of the specified unit. The health is returned in real points only if the unit is in the player's group (party or raid). Otherwise, a percentage is returned (0-100). (Note, that the player, the player's pet, and any group member pets are considered to be in the group.)

Template:WoW API