Get the gender of a unit.


Parameter Edit

String - the UnitID (e.g. "player", "target", "party1", "raid1", etc..)

Returns Edit

Integer - returns 0 for male and 1 for female, 2 for elite mobs and above 2 for boss mobs
Note: if the specified unit doesn't exist, it returns 0 rather than nil.

Example Edit

Display the gender of the player in a language neutral way

DEFAULT_CHAT_FRAME:AddMessage((UnitSex("player") ~= 0 and getglobal("C_FEMALE")) or getglobal("C_MALE"))

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.