Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onSwitcher(EntityDamageByEntityEvent e) {
- Player victim = (Player)e.getEntity();
- Player damager = (Player)e.getDamager();
- if(Kits.SwitcherKit.containsKey(damager)) {
- if(victim.getLastDamageCause().equals(Material.SNOW_BALL)) {
- victim.getPlayer().teleport(damager.getLocation());
- damager.getPlayer().teleport(victim.getLocation());
- }
- }
- }
- @SuppressWarnings("unused")
- @EventHandler
- public void onNinja(EntityDamageByEntityEvent e) {
- Entity damager = (Player)e.getDamager();
- Player victim = (Player)e.getEntity();
- if(Kits.NinjaKit.containsKey(victim)) {
- if(((e.getEntity() instanceof Player)) && ((e.getDamager() instanceof Egg))) {
- for (Entity en : e.getEntity().getNearbyEntities(3.0D, 3.0D, 3.0D))
- victim.addPotionEffect(new PotionEffect (PotionEffectType.SLOW, 100, 1));
- victim.addPotionEffect(new PotionEffect (PotionEffectType.BLINDNESS, 100, 1));
- victim.addPotionEffect(new PotionEffect (PotionEffectType.POISON, 100, 1));
- victim.getWorld().playEffect(victim.getLocation(), Effect.SMOKE, 20);
- victim.getWorld().playSound(victim.getLocation(), Sound.EXPLODE, 1, 1);
- }
- }
- }
- @EventHandler
- public void onFrost(EntityDamageByEntityEvent e) {
- final Player victim = (Player)e.getEntity();
- Entity damager = (Player)e.getDamager();
- if(Kits.FrostyKit.containsKey(damager)) {
- if(((e.getEntity() instanceof Player)) && ((e.getDamager() instanceof Snowball))) {
- Kits.Frozen.add(victim);
- }
- if(Kits.Frozen.contains(victim)){
- victim.teleport(victim.getLocation());
- victim.sendMessage(ChatColor.AQUA + "You are frozen in time!");
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- Kits.Frozen.remove(victim);
- victim.sendMessage(ChatColor.AQUA + "You are unfrozen!");
- }
- }, 100L);
- }
- }
- }
- F
- @EventHandler
- public void onFlash(PlayerInteractEvent e) {
- final Player p = (Player)e.getPlayer();
- if(Kits.FlashKit.containsKey(p)) {
- if(p.getInventory().getItemInHand().getType() == Material.REDSTONE_TORCH_ON){
- if((e.getAction() == Action.RIGHT_CLICK_AIR) || (e.getAction() == Action.RIGHT_CLICK_BLOCK)) {
- if(Kits.Flashcd.contains(p)) {
- p.sendMessage(ChatColor.RED + "You must wait to use this agian!");
- }
- if(p.getEyeLocation().length() >= 80){
- p.sendMessage(ChatColor.RED + "You may not teleport that far!");
- }else{
- p.teleport(p.getEyeLocation());
- p.getInventory().setItemInHand(new ItemStack(Material.REDSTONE_TORCH_OFF));
- Kits.Flashcd.add(p);
- Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
- public void run() {
- Kits.Flashcd.remove(p);
- p.getInventory().setItem(1, new ItemStack(Material.REDSTONE_TORCH_ON));
- p.sendMessage(ChatColor.GREEN + "You may now teleport agian!");
- }
- }, 600L);
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement