Advertisement
Guest User

Untitled

a guest
Sep 7th, 2013
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. @EventHandler
  2. public void onPrick(EntityDamageByEntityEvent e) {
  3. final Player damager = (Player)e.getDamager();
  4. Player victim = (Player)e.getEntity();
  5. if(Kits.PrickKit.containsKey(damager)) {
  6. if(damager.getInventory().getItemInHand().getType() == Material.CACTUS) {
  7. if(Prickcd.contains(damager)) {
  8. damager.sendMessage(ChatColor.RED + "You must wait to use this agian!");
  9. }else{
  10. Prickcd.add(damager);
  11. e.setCancelled(true);
  12. victim.addPotionEffect(new PotionEffect(PotionEffectType.POISON, 200, 1));
  13. victim.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 200, 1));
  14. victim.sendMessage(ChatColor.GREEN + "You have been pricked!");
  15. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask((Plugin) this, new Runnable(){
  16. public void run() {
  17. Prickcd.remove(damager);
  18. damager.sendMessage(ChatColor.GREEN + "You may now prick again!");
  19. }
  20. }, 200L);
  21. }
  22. }
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement