SHARE
TWEET

Untitled

a guest Jul 18th, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     @EventHandler
  2.     public void onDamage(EntityDamageByEntityEvent e){
  3.         if(e.getDamager() instanceof Arrow){
  4.             if(e.getEntity() instanceof Player){
  5.                 Arrow arrow = (Arrow) e.getDamager();
  6.                 if(arrow.getShooter() instanceof Player){
  7.                     Player damager = (Player) arrow.getShooter();
  8.                     Player victim = (Player) e.getEntity();
  9.  
  10.                     double y1 = arrow.getLocation().getY();
  11.                     double y2 = victim.getLocation().getY();
  12.                     if((y1 - y2) > 1.4){
  13.                         damager.getWorld().spawnParticle(Particle.LAVA, arrow.getLocation(), 5);
  14.                         damager.sendMessage("§cHeadshot su " + victim.getName());
  15.                     }
  16.                 }
  17.             }
  18.         }
  19.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top