UnitPower

From Warcraft Wiki
Jump to navigation Jump to search

Returns the current power resource of the unit.

power = UnitPower(unitToken [, powerType, unmodified])

Arguments

unitToken
string : UnitId
powerType
Enum.PowerType?🔗 - Type of resource (mana/rage/energy/etc) to query
unmodified
boolean? - Return the higher precision internal value (for graphical use only)

Returns

power
number - the unit's current power level

Details

  • If no type is specified, UnitPower returns the current primary type, e.g., energy for a druid in cat form.
  • You can determine the current primary power type via UnitPowerType()
Related Events UNIT_POWER_UPDATE
UNIT_POWER_FREQUENT
Related API UnitPowerTypeUnitPowerMax

Example

Prints the current amount of mana for the player.

/dump UnitPower("player", Enum.PowerType.Mana)

Patch changes

Wrath-Logo-Small.png Patch 3.0.2 (2008-10-14): Added, replaces UnitMana()