Advertisement
Guest User

Untitled

a guest
Sep 17th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. @EventHandler
  2. public void onFrost(EntityDamageByEntityEvent e) {
  3. final Player victim = (Player)e.getEntity();
  4. Snowball snowball = (Snowball)e.getDamager();
  5. if(Kits.FrostyKit.containsKey(snowball.getShooter())) {
  6. if(((victim instanceof Player)) && (snowball instanceof Snowball)){
  7. Kits.Frozen.add(victim);
  8.  
  9. }else if(Kits.Frozen.contains(victim)){
  10. victim.teleport(victim.getPlayer().getLocation());
  11. victim.sendMessage(ChatColor.AQUA + "You are frozen in time!");
  12. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
  13. public void run() {
  14. Kits.Frozen.remove(victim);
  15. victim.sendMessage(ChatColor.AQUA + "You are unfrozen!");
  16. }
  17. }, 100L);
  18. }
  19. }
  20. }
  21.  
  22.  
  23.  
  24.  
  25. @EventHandler
  26. public void onNinja(EntityDamageByEntityEvent e) {
  27. Entity damager = e.getDamager();
  28. Player victim = (Player)e.getEntity();
  29. if(Kits.NinjaKit.containsKey(victim)) {
  30. if(((victim instanceof LivingEntity)) && ((damager instanceof Egg))) {
  31. victim.addPotionEffect(new PotionEffect (PotionEffectType.SLOW, 100, 1));
  32. victim.addPotionEffect(new PotionEffect (PotionEffectType.BLINDNESS, 100, 1));
  33. victim.addPotionEffect(new PotionEffect (PotionEffectType.POISON, 100, 1));
  34. victim.getWorld().playEffect(victim.getLocation(), Effect.SMOKE, 20);
  35. victim.getWorld().playSound(victim.getLocation(), Sound.EXPLODE, 1, 1);
  36. }
  37. }
  38. }
  39.  
  40. @EventHandler
  41. public void onSwitcher(EntityDamageByEntityEvent e) {
  42. Player victim = (Player)e.getEntity();
  43. Snowball snowball = (Snowball) e.getDamager();
  44. if(Kits.SwitcherKit.containsKey(victim)) {
  45. if(((victim instanceof Player)) && (snowball instanceof Snowball)){
  46. victim.getPlayer().teleport(snowball.getShooter().getLocation());
  47. snowball.getShooter().teleport(victim.getLocation());
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement