#HOWTO: Removing a player's auras with Mythic Plugins

1 messages · Page 1 of 1 (latest)

cedar gulch
#

If you needed to remove a specific aura, or all auras, here's how you do it:

First off you need to get the AuraRegistry

AuraRegistry registry = MythicBukkit.inst().getSkillManager().getAuraManager().getAuraRegistry(player.getUniqueId());

Then if you want to remove a single one:

registry.removeStack(auraName, registry.getStacks(auraName));

if you want to remove every aura:

for (String aura : registry.getAuras().keySet()) {
  registry.removeStack(aura, registry.getStacks(aura));
}

methods:

public static void removeAllAuras(Player player) {
  AuraRegistry registry = MythicBukkit.inst().getSkillManager().getAuraManager().getAuraRegistry(player.getUniqueId());

  for (String aura : registry.getAuras().keySet()) {
    registry.removeStack(aura, registry.getStacks(aura));
  }
}

public static void removeAuras(Player player, String... auras) {
  AuraRegistry registry = MythicBukkit.inst().getSkillManager().getAuraManager().getAuraRegistry(player.getUniqueId());

  for (String aura : auras) {
    registry.removeStack(aura, registry.getStacks(aura));
  }
}

Figured this would help someone :D

#

HOWTO: Removing a player's auras with Mythic Plugins

visual pawn
#

That seems like some extremely specific knowledge to be stored away in a thread.

cedar gulch
#

I have no clue where to put it

#

There @visual pawn