Skip to content

Instantly share code, notes, and snippets.

@Splodgebox
Created March 1, 2018 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Splodgebox/94bf5d617a3c66a73ffd5aa8c57cf0e5 to your computer and use it in GitHub Desktop.
Save Splodgebox/94bf5d617a3c66a73ffd5aa8c57cf0e5 to your computer and use it in GitHub Desktop.
package me.splodge.heal.commands;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.entity.Player;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import org.inventivetalent.particle.ParticleEffect;
public class Heal implements org.bukkit.command.CommandExecutor{
public boolean onCommand(org.bukkit.command.CommandSender sender, Command cmd, String label, String[] args)
{
Player player = (Player)sender;
if (player.hasPermission("heal.allow")) {
if ((sender instanceof Player)) {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&a&l(!) HEALED (!)"));
player.addPotionEffect(new PotionEffect(PotionEffectType.REGENERATION, 60, 2));
player.addPotionEffect(new PotionEffect(PotionEffectType.BLINDNESS, 60, 2));
ParticleEffect.FLAME.send(Bukkit.getOnlinePlayers(), player.getLocation(), 0, 0, 0, 0, 1);
return true;
}
}
else {
player.sendMessage(ChatColor.translateAlternateColorCodes('&', "&4&lYou Don't Have The Right Permissions!"));
}
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment