Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.vlad.tutorial.commands;
- import org.bukkit.ChatColor;
- import org.bukkit.command.CommandExecutor;
- import org.bukkit.command.Command;
- import org.bukkit.command.CommandSender;
- import org.bukkit.entity.Player;
- import org.bukkit.potion.PotionEffect;
- import org.bukkit.potion.PotionEffectType;
- public class BeaconC implements CommandExecutor{
- public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) {
- Player player = (Player) sender;
- if(player.hasPermission("dwarf.beacon")) {
- if(player.hasPotionEffect(PotionEffectType.INCREASE_DAMAGE) && player.hasPotionEffect(PotionEffectType.DAMAGE_RESISTANCE) && player.hasPotionEffect(PotionEffectType.FAST_DIGGING) && player.hasPotionEffect(PotionEffectType.JUMP) && player.hasPotionEffect(PotionEffectType.REGENERATION) && player.hasPotionEffect(PotionEffectType.SPEED)){
- player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
- player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
- player.removePotionEffect(PotionEffectType.FAST_DIGGING);
- player.removePotionEffect(PotionEffectType.JUMP);
- player.removePotionEffect(PotionEffectType.REGENERATION);
- player.removePotionEffect(PotionEffectType.SPEED);
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "[FireCraft]" + ChatColor.GREEN + " Full Beacon Effects has been disabled for " + ChatColor.GOLD + "" + ChatColor.BOLD + player.getName() + ChatColor.GREEN + ".");
- }
- if(!player.hasPermission("dwarf.beacon")) {
- player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "[FireCraft]" + ChatColor.RESET + "" + ChatColor.RED + " No perm, sorry!");
- }
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment