mirror of
https://hub.spigotmc.org/stash/scm/spigot/bukkit.git
synced 2025-08-21 05:44:17 +00:00
Add 1.6 effect clear functionality. Fixes BUKKIT-4473
This commit is contained in:
parent
2f044fe1f8
commit
5c04714882
1 changed files with 9 additions and 1 deletions
|
@ -16,7 +16,7 @@ public class EffectCommand extends VanillaCommand {
|
|||
public EffectCommand() {
|
||||
super("effect");
|
||||
this.description = "Adds/Removes effects on players";
|
||||
this.usageMessage = "/effect <player> <effect> [seconds] [amplifier]";
|
||||
this.usageMessage = "/effect <player> <effect|clear> [seconds] [amplifier]";
|
||||
this.setPermission("bukkit.command.effect");
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,14 @@ public class EffectCommand extends VanillaCommand {
|
|||
return true;
|
||||
}
|
||||
|
||||
if ("clear".equalsIgnoreCase(args[1])) {
|
||||
for (PotionEffect effect : player.getActivePotionEffects()) {
|
||||
player.removePotionEffect(effect.getType());
|
||||
}
|
||||
sender.sendMessage(String.format("Took all effects from %s", args[0]));
|
||||
return true;
|
||||
}
|
||||
|
||||
PotionEffectType effect = PotionEffectType.getByName(args[1]);
|
||||
|
||||
if (effect == null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue