Skip to content
everloot

Lore archive · Warcraft Wiki, 2023 dump

API CancelPlayerBuff

Last wiki revision 2020-01-08

Removes a specific buff from the player.

CancelPlayerBuff(buffIndex);

  • buffIndex : The index of the buff to remove. Can be obtained with GetPlayerBuff. Can also use buff name since the 2.3 patch.

CancelPlayerBuff(GetPlayerBuff(0,"HELPFUL"))

  • Result : Removes the first (right-most in the default UI) buff from the player.

(tested on live servers 2.0)

  • This function is not protected nor limited in any way to hardware event restriction Blizzard used so far. This function can be called freely from an AddOn to auto-remove a given buff.
  • This function uses a zero-based index, while UnitBuff does not.
  • The Burning Crusade: GetPlayerBuff returns 0 if the buff doesn't exist. It stands to reason that this function would then be 1-based in TBC.

Source

https://warcraft.wiki.gg/wiki/API_CancelPlayerBuff · retrieved 2023-11-13 · CC BY-SA 4.0

Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.

This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.