SHARE
TWEET

Untitled

a guest Apr 21st, 2017 55 in 24 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  @EventHandler
  2.     public void onShootBow(EntityDamageByEntityEvent e){
  3.         Entity entity = e.getEntity();
  4.         DamageCause cause = e.getCause();
  5.         if (entity.getType().equals(EntityType.PLAYER) && cause.equals(DamageCause.PROJECTILE)){
  6.             Entity damager = e.getDamager();
  7.             if (damager.getType().equals(EntityType.ARROW)){
  8.                 Arrow arrow = (Arrow) damager;
  9.                 Entity shoot = (Entity) arrow.getShooter();
  10.                 if (shoot.getType().equals(EntityType.PLAYER)){
  11.                     Player p = (Player) shoot;
  12.                     Player h = (Player) entity;
  13.                     double damage = e.getFinalDamage();
  14.                     double hp = h.getHealth() - damage;
  15.                     hp=hp<0?0:hp;
  16.                     BountifulAPI.sendActionBar(p, h.getDisplayName().replace('&', '§') + " &7➠ &4".replace('&', '§') + "&4❤ &6 ".replace('&', '§') + String.format("%.1f", hp) + "&7(&e".replace('&', '§') + String.format("%.1f", damage) + "&7)".replace('&', '§'), -1);
  17.                 }
  18.             }
  19.            
  20.         }
  21.  
  22.     }
RAW Paste Data
Top