Advertisement
Guest User

Untitled

a guest
Sep 15th, 2013
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.95 KB | None | 0 0
  1. @EventHandler
  2. public void onSwitcher(EntityDamageByEntityEvent e) {
  3. Player victim = (Player)e.getEntity();
  4. Player damager = (Player)e.getDamager();
  5. if(Kits.SwitcherKit.containsKey(damager)) {
  6. if(victim.getLastDamageCause().equals(Material.SNOW_BALL)) {
  7. victim.getPlayer().teleport(damager.getLocation());
  8. damager.getPlayer().teleport(victim.getLocation());
  9. }
  10. }
  11. }
  12.  
  13.  
  14.  
  15.  
  16.  
  17. @SuppressWarnings("unused")
  18. @EventHandler
  19. public void onNinja(EntityDamageByEntityEvent e) {
  20. Entity damager = (Player)e.getDamager();
  21. Player victim = (Player)e.getEntity();
  22. if(Kits.NinjaKit.containsKey(victim)) {
  23. if(((e.getEntity() instanceof Player)) && ((e.getDamager() instanceof Egg))) {
  24. for (Entity en : e.getEntity().getNearbyEntities(3.0D, 3.0D, 3.0D))
  25. victim.addPotionEffect(new PotionEffect (PotionEffectType.SLOW, 100, 1));
  26. victim.addPotionEffect(new PotionEffect (PotionEffectType.BLINDNESS, 100, 1));
  27. victim.addPotionEffect(new PotionEffect (PotionEffectType.POISON, 100, 1));
  28. victim.getWorld().playEffect(victim.getLocation(), Effect.SMOKE, 20);
  29. victim.getWorld().playSound(victim.getLocation(), Sound.EXPLODE, 1, 1);
  30. }
  31. }
  32. }
  33.  
  34.  
  35.  
  36.  
  37. @EventHandler
  38. public void onFrost(EntityDamageByEntityEvent e) {
  39. final Player victim = (Player)e.getEntity();
  40. Entity damager = (Player)e.getDamager();
  41. if(Kits.FrostyKit.containsKey(damager)) {
  42. if(((e.getEntity() instanceof Player)) && ((e.getDamager() instanceof Snowball))) {
  43. Kits.Frozen.add(victim);
  44. }
  45. if(Kits.Frozen.contains(victim)){
  46. victim.teleport(victim.getLocation());
  47. victim.sendMessage(ChatColor.AQUA + "You are frozen in time!");
  48. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
  49. public void run() {
  50. Kits.Frozen.remove(victim);
  51. victim.sendMessage(ChatColor.AQUA + "You are unfrozen!");
  52. }
  53. }, 100L);
  54. }
  55. }
  56. }
  57.  
  58. F
  59.  
  60. @EventHandler
  61. public void onFlash(PlayerInteractEvent e) {
  62. final Player p = (Player)e.getPlayer();
  63. if(Kits.FlashKit.containsKey(p)) {
  64. if(p.getInventory().getItemInHand().getType() == Material.REDSTONE_TORCH_ON){
  65. if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
  66. if(Kits.Flashcd.contains(p)) {
  67. p.sendMessage(ChatColor.RED + "You must wait to use this agian!");
  68. }
  69. if(p.getEyeLocation().length() >= 80){
  70. p.sendMessage(ChatColor.RED + "You may not teleport that far!");
  71. }else{
  72. p.teleport(p.getEyeLocation());
  73. p.getInventory().setItemInHand(new ItemStack(Material.REDSTONE_TORCH_OFF));
  74. Kits.Flashcd.add(p);
  75. Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
  76. public void run() {
  77. Kits.Flashcd.remove(p);
  78. p.getInventory().setItem(1, new ItemStack(Material.REDSTONE_TORCH_ON));
  79. p.sendMessage(ChatColor.GREEN + "You may now teleport agian!");
  80. }
  81. }, 600L);
  82. }
  83. }
  84. }
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement