API UnitSex

From Wowpedia
Jump to: navigation, search

Returns the gender of the specified unit.

gender = UnitSex("unit")

Arguments

unit 
String - unitId of the unit to query, e.g. "player".

Returns

gender 
Number - One of the following values, or nil if the unit is unknown:
  • 1 = Neutrum / Unknown
  • 2 = Male
  • 3 = Female

Details

  • UnitSex("target") will return 1 (neuter/unknown) on "sheeped" mobs, no matter their "true" gender. (Needs reverification after 1.11). UnitSex("player") does not return 1 on "penguinification".
  • Prior to Patch 1.11, the return values were 0=male, 1=female, 2=unknown.