iTaeyeon

java pots code

Apr 14th, 2020 (edited)
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.88 KB | None | 0 0
  1. package com.vlad.tutorial.commands;
  2.  
  3. import org.bukkit.ChatColor;
  4. import org.bukkit.command.CommandExecutor;
  5. import org.bukkit.command.Command;
  6. import org.bukkit.command.CommandSender;
  7. import org.bukkit.entity.Player;
  8. import org.bukkit.potion.PotionEffect;
  9. import org.bukkit.potion.PotionEffectType;
  10.  
  11.  
  12. public class BeaconC implements CommandExecutor{
  13.     public boolean onCommand(CommandSender sender, Command arg1, String arg2, String[] arg3) {
  14.         Player player = (Player) sender;
  15.        
  16.             if(player.hasPermission("dwarf.beacon")) {
  17.             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)){
  18.             player.removePotionEffect(PotionEffectType.INCREASE_DAMAGE);
  19.             player.removePotionEffect(PotionEffectType.DAMAGE_RESISTANCE);
  20.             player.removePotionEffect(PotionEffectType.FAST_DIGGING);
  21.             player.removePotionEffect(PotionEffectType.JUMP);
  22.             player.removePotionEffect(PotionEffectType.REGENERATION);
  23.             player.removePotionEffect(PotionEffectType.SPEED);
  24.             player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "[FireCraft]" + ChatColor.GREEN + " Full Beacon Effects has been disabled for " + ChatColor.GOLD + "" + ChatColor.BOLD + player.getName() + ChatColor.GREEN + ".");
  25.        
  26.     }
  27.            
  28.            
  29.                     if(!player.hasPermission("dwarf.beacon")) {
  30.                     player.sendMessage(ChatColor.RED + "" + ChatColor.BOLD + "[FireCraft]" + ChatColor.RESET + "" + ChatColor.RED + " No perm, sorry!");
  31.                    
  32.                     }
  33.            
  34.    
  35. }
  36.         return true;
  37. }
  38. }
Add Comment
Please, Sign In to add comment