Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onPrick(EntityDamageByEntityEvent e) {
- final Player damager = (Player)e.getDamager();
- Player victim = (Player)e.getEntity();
- if(Kits.PrickKit.containsKey(damager)) {
- if(damager.getInventory().getItemInHand().getType() == Material.CACTUS) {
- if(Prickcd.contains(damager)) {
- damager.sendMessage(ChatColor.RED + "You must wait to use this agian!");
- }else{
- Prickcd.add(damager);
- e.setCancelled(true);
- victim.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 200, 1));
- victim.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 200, 1));
- victim.sendMessage(ChatColor.GREEN + "You have been pricked!");
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin) this, new Runnable(){
- public void run() {
- Prickcd.remove(damager);
- damager.sendMessage(ChatColor.GREEN + "You may now prick again!");
- }
- }, 200L);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement