Returns the power type (energy, mana, rage) of the given unit. Does not return color values for common power types (mana, rage, energy, focus, and runic power); the canonical colors for these can be found in the PowerBarColor table. Color values may be included for special power types such as those used by vehicles.


See also Unit functions.

Signature:

powerType, powerToken, altR, altG, altB = UnitPowerType("unit") or UnitPowerType("name")

Arguments:

  • unit - A unit to query (string, unitID)
  • name - The name of a unit to query; only valid for player, pet, and party/raid members (string)

Returns:

  • powerType - A number identifying the power type (number)

    • 0 - Mana
    • 1 - Rage
    • 2 - Focus
    • 3 - Energy
    • 6 - Runic Power

  • powerToken - The name of a global variable containing the localized name of the power type (string)

  • altR - Red component of the color used for displaying this power type (number)

  • altG - Green component of the color used for displaying this power type (number)

  • altB - Blue component of the color used for displaying this power type (number)