Wowpedia

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

READ MORE

Wowpedia
Advertisement

Returns the creature type of the specified unit -- "Humanoid", "Demon", "Beast" or nil.

  local creatureType = UnitCreatureType(unit)



Arguments

UnitId
The unit name (e.g. "target", "mouseover", "player")

Returns

creatureType
A string representing the creature type or nothing if no target or invalid specification.

Examples


  DEFAULT_CHAT_FRAME:AddMessage(UnitCreatureType('target'))

Result

Prints the creature type to your default message window of whatever you have targeted.
-or-
  if (UnitCreatureType("target") == "Humanoid") then 
     CastSpellByName("Sap(Rank 3)")
  end

Result

If the creature targeted is a Humanoid and you are a rogue with Sap, Rank 3 -- it will launch that attack.



Description Returns the creature type of the specified unit -- "Humanoid", "Demon", "Beast" or nil -- if the unit does not have a creature type because you have no target, or the like.



Template:WoW API

Advertisement