Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void onFrost(EntityDamageByEntityEvent e) {
- final Player victim = (Player)e.getEntity();
- Snowball snowball = (Snowball)e.getDamager();
- if(Kits.FrostyKit.containsKey(snowball.getShooter())) {
- if(((victim instanceof Player)) && (snowball instanceof Snowball)){
- Kits.Frozen.add(victim);
- }else if(Kits.Frozen.contains(victim)){
- victim.teleport(victim.getPlayer().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);
- }
- }
- }
- @EventHandler
- public void onNinja(EntityDamageByEntityEvent e) {
- Entity damager = e.getDamager();
- Player victim = (Player)e.getEntity();
- if(Kits.NinjaKit.containsKey(victim)) {
- if(((victim instanceof LivingEntity)) && ((damager instanceof Egg))) {
- 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 onSwitcher(EntityDamageByEntityEvent e) {
- Player victim = (Player)e.getEntity();
- Snowball snowball = (Snowball) e.getDamager();
- if(Kits.SwitcherKit.containsKey(victim)) {
- if(((victim instanceof Player)) && (snowball instanceof Snowball)){
- victim.getPlayer().teleport(snowball.getShooter().getLocation());
- snowball.getShooter().teleport(victim.getLocation());
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement