Module pet

Pet functions are the profile API table `pet` (br.api.profile.pet); profiles use it by name.

pet.active.* is the player's current pet, pet..* each pet in the pet list (System/Lists/Pets.lua), and the rest are commands for the pet and what its action bar says.

Functions

pet.active.exists () Checks if the player's current pet exists
pet.active.count () Counts the player's pets of the current pet's kind
pet.active.id () Gets the ID of the player's current pet
attack ([thisUnit]) Sends the pet to attack a unit (its current target when thisUnit is nil).
attacking () True while the pet is attacking.
autocast (spellKey) True when the pet's ability casts itself.
callName (spellKey) The name of the pet a Call Pet spell summons (Hunter), "" when its stable slot is empty.
dead () True when the combat log saw the pet die and it hasn't been revived.
dismiss () Dismisses the pet.
follow () Calls the pet back to follow the player.
happiness () The pet's happiness: 1 unhappy, 2 content, 3 happy (2 on clients without happiness).
hasActivePet () True when the Hunter's active stable slot holds a pet (out, dismissed or dead), so Call Pet can work.
mode () The pet's mode: "assist", "defensiveAssist", "defensive", "passive", "aggressive" or "none".
setAutocast (spellKey) Turns the autocast of the pet's ability on or off.
setMode (mode) Puts the pet in a mode (the names pet.mode returns); false when this client has no such mode.
stopAttack () Makes the pet stop attacking.
pet. () Counts the player's pets of this kind
pet. () True when a pet of this kind is out
pet. () True when a pet of this kind is out (pet..exists)
pet. () This pet kind's NPC ID


Functions

pet.active.exists ()
Checks if the player's current pet exists

Returns:

    boolean True if player has an active pet, false otherwise
pet.active.count ()
Counts the player's pets of the current pet's kind

Returns:

    number
pet.active.id ()
Gets the ID of the player's current pet

Returns:

    number
attack ([thisUnit])
Sends the pet to attack a unit (its current target when thisUnit is nil).

Parameters:

attacking ()
True while the pet is attacking.

Returns:

    boolean
autocast (spellKey)
True when the pet's ability casts itself.

Parameters:

  • spellKey string A spell in the class spell list

Returns:

    boolean
callName (spellKey)
The name of the pet a Call Pet spell summons (Hunter), "" when its stable slot is empty.

Parameters:

  • spellKey string A Call Pet spell in the class spell list (callPet1 ... callPet5)

Returns:

    string
dead ()
True when the combat log saw the pet die and it hasn't been revived.

Returns:

    boolean
dismiss ()
Dismisses the pet.
follow ()
Calls the pet back to follow the player.
happiness ()
The pet's happiness: 1 unhappy, 2 content, 3 happy (2 on clients without happiness).

Returns:

    number
hasActivePet ()
True when the Hunter's active stable slot holds a pet (out, dismissed or dead), so Call Pet can work.

Returns:

    boolean
mode ()
The pet's mode: "assist", "defensiveAssist", "defensive", "passive", "aggressive" or "none".

Returns:

    string
setAutocast (spellKey)
Turns the autocast of the pet's ability on or off.

Parameters:

  • spellKey string A spell in the class spell list
setMode (mode)
Puts the pet in a mode (the names pet.mode returns); false when this client has no such mode.

Parameters:

Returns:

    boolean
stopAttack ()
Makes the pet stop attacking.
pet. ()
Counts the player's pets of this kind

Returns:

    number
pet. ()
True when a pet of this kind is out

Returns:

    boolean
pet. ()
True when a pet of this kind is out (pet..exists)

Returns:

    boolean
pet. ()
This pet kind's NPC ID

Returns:

    number
generated by LDoc 1.5.0 Last updated 2026-11-16 01:18:17