Phanx-gpuser (talk | contribs) No edit summary |
Phanx-gpuser (talk | contribs) (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 [[ |
+ | :;unit : string - the [[UnitId]] to query |
==Returns== |
==Returns== |
Revision as of 07:00, 5 March 2009
Automated updating of API pages at this location, to reflect patch changes, has ceased from 10.1.7 onwards. |
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.