Wowpedia

We have moved to Warcraft Wiki. Click here for information and the new URL.

READ MORE

Wowpedia
No edit summary
(Cleanup, add list of possible return values, remove irrelevant information like "since WoW 2.0 you can't use CastSpellByName so this function won't help you automate spell selection")
Line 6: Line 6:
   
 
==Arguments==
 
==Arguments==
:;unit : string - the [[UnitID]] to query
+
:;unit : string - the [[UnitId]] to query
   
 
==Returns==
 
==Returns==

Revision as of 07:00, 5 March 2009

Returns the creature type of the specified unit.

creatureType = UnitCreatureType(unit)

Arguments

unit
string - the UnitId to query

Returns

creatureType
string - the localized creature type of the unit

Examples

print(UnitCreatureType("target"))

Result

Prints the target's creature type to the chat frame.

Notes

  • Returns nil if the unit does not exist, or if the unit's creature type isn't available.
  • As of patch 3.0.9, the possible (English) return values are:
    • Beast
    • Critter
    • Demon
    • Dragonkin
    • Elemental
    • Giant
    • Humanoid
    • Mechanical
    • Non-combat Pet
    • Not specified
    • Undead
  • The default Blizzard UI displays an empty string instead of "Not specified" for units with that creature type.