Program: 84926
Project: 84926
Buggy source:
@Override public void onEntityDamage(EntityDamageEvent event){
  event.setCancelled(true);
  try {
    if (event.getCause() == DamageCause.FALL && event.getDamage() >= 4) {
      if (event.getEntity() instanceof Player) {
        plugin.p((Player)event.getEntity()).incHealth(1,(Player)event.getEntity(),0,null);
      }
      event.setCancelled(false);
    }
    event.setDamage(1);
    if (event instanceof EntityDamageByProjectileEvent) {
      if (event.getEntity() instanceof Wolf) {
        plugin.wolves.remove(event.getEntity());
        event.getEntity().remove();
        return;
      }
 else {
        int reason=2;
        ownable ks=null;
        if (((CraftArrow)((EntityDamageByProjectileEvent)event).getProjectile()).getHandle() instanceof CArrow) {
          reason=((CArrow)((CraftArrow)((EntityDamageByProjectileEvent)event).getProjectile()).getHandle()).reason;
          ks=((CArrow)((CraftArrow)((EntityDamageByProjectileEvent)event).getProjectile()).getHandle()).killstreak;
        }
        Player attacker=(Player)(((EntityDamageByProjectileEvent)event).getDamager());
        Player defender=(Player)(((EntityDamageByProjectileEvent)event).getEntity());
        if (plugin.game.canHit(attacker,defender)) {
          if (reason == 2) {
            double dif=(((EntityDamageByProjectileEvent)event).getProjectile().getLocation().getY() - event.getEntity().getLocation().getY()) - 1.5;
            if (dif > 0.1 && dif < 0.5) {
              reason=7;
            }
          }
          plugin.p(defender).incHealth(1,attacker,reason,ks);
          event.setCancelled(false);
        }
      }
    }
 else     if (event instanceof EntityDamageByEntityEvent) {
      if (((EntityDamageByEntityEvent)event).getDamager() instanceof Player && event.getEntity() instanceof Player) {
        Player attacker=(Player)(((EntityDamageByEntityEvent)event).getDamager());
        Player defender=(Player)(((EntityDamageByEntityEvent)event).getEntity());
        Location a=attacker.getLocation();
        Location d=defender.getLocation();
        if (attacker.getItemInHand().getType() == Material.IRON_SWORD) {
          if (plugin.game.canHit(attacker,defender)) {
            double dist=Math.sqrt(Math.pow(a.getX() - d.getX(),2) + Math.pow(a.getZ() - d.getZ(),2));
            if (dist < 1.8) {
              plugin.p(defender).incHealth(2,attacker,1,null);
              event.setCancelled(false);
            }
          }
          if (defender.getHealth() < 3) {
            event.setDamage(0);
          }
        }
      }
 else       if (((EntityDamageByEntityEvent)event).getDamager() instanceof Wolf && ((EntityDamageByEntityEvent)event).getEntity() instanceof Player) {
        Player defender=(Player)(((EntityDamageByEntityEvent)event).getEntity());
        for (        CWolfPack i : plugin.wolves) {
          if (i.wolf.contains(((EntityDamageByEntityEvent)event).getDamager())) {
            if (plugin.game.canHit(i.getOwner(),defender)) {
              plugin.p(defender).incHealth(2,i.getOwner(),4,i);
            }
            i.remove((Wolf)((EntityDamageByEntityEvent)event).getDamager());
          }
        }
      }
 else       if (((EntityDamageByEntityEvent)event).getEntity() instanceof Wolf) {
        plugin.wolves.remove(event.getEntity());
        ((EntityDamageByEntityEvent)event).getEntity().remove();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    if (event.getEntity() instanceof Player) {
      ((Player)event.getEntity()).teleport(plugin.teamselect);
    }
  }
}

Fixed version (ground truth):
@Override public void onEntityDamage(EntityDamageEvent event){
  event.setCancelled(true);
  try {
    if (event.getCause() == DamageCause.FALL && event.getDamage() >= 4) {
      if (event.getEntity() instanceof Player) {
        plugin.p((Player)event.getEntity()).incHealth(1,(Player)event.getEntity(),0,null);
      }
      event.setCancelled(false);
    }
    event.setDamage(1);
    if (event instanceof EntityDamageByProjectileEvent) {
      if (event.getEntity() instanceof Wolf) {
        plugin.wolves.remove(event.getEntity());
        event.getEntity().remove();
        return;
      }
 else {
        int reason=2;
        Object ks=null;
        if (((CraftArrow)((EntityDamageByProjectileEvent)event).getProjectile()).getHandle() instanceof CArrow) {
          reason=((CArrow)((CraftArrow)((EntityDamageByProjectileEvent)event).getProjectile()).getHandle()).reason;
          ks=((CArrow)((CraftArrow)((EntityDamageByProjectileEvent)event).getProjectile()).getHandle()).killstreak;
        }
 else {
          ks=((EntityDamageByProjectileEvent)event).getProjectile();
        }
        Player attacker=(Player)(((EntityDamageByProjectileEvent)event).getDamager());
        Player defender=(Player)(((EntityDamageByProjectileEvent)event).getEntity());
        if (plugin.game.canHit(attacker,defender)) {
          if (reason == 2) {
            double dif=(((EntityDamageByProjectileEvent)event).getProjectile().getLocation().getY() - event.getEntity().getLocation().getY()) - 1.5;
            if (dif > 0.1 && dif < 0.5) {
              reason=7;
            }
          }
          plugin.p(defender).incHealth(1,attacker,reason,ks);
          event.setCancelled(false);
        }
      }
    }
 else     if (event instanceof EntityDamageByEntityEvent) {
      if (((EntityDamageByEntityEvent)event).getDamager() instanceof Player && event.getEntity() instanceof Player) {
        Player attacker=(Player)(((EntityDamageByEntityEvent)event).getDamager());
        Player defender=(Player)(((EntityDamageByEntityEvent)event).getEntity());
        Location a=attacker.getLocation();
        Location d=defender.getLocation();
        if (attacker.getItemInHand().getType() == Material.IRON_SWORD) {
          if (plugin.game.canHit(attacker,defender)) {
            double dist=Math.sqrt(Math.pow(a.getX() - d.getX(),2) + Math.pow(a.getZ() - d.getZ(),2));
            if (dist < 1.8) {
              plugin.p(defender).incHealth(2,attacker,1,null);
              event.setCancelled(false);
            }
          }
          if (defender.getHealth() < 3) {
            event.setDamage(0);
          }
        }
      }
 else       if (((EntityDamageByEntityEvent)event).getDamager() instanceof Wolf && ((EntityDamageByEntityEvent)event).getEntity() instanceof Player) {
        Player defender=(Player)(((EntityDamageByEntityEvent)event).getEntity());
        for (        CWolfPack i : plugin.wolves) {
          if (i.wolf.contains(((EntityDamageByEntityEvent)event).getDamager())) {
            if (plugin.game.canHit(i.getOwner(),defender)) {
              plugin.p(defender).incHealth(2,i.getOwner(),4,i);
            }
            i.remove((Wolf)((EntityDamageByEntityEvent)event).getDamager());
          }
        }
      }
 else       if (((EntityDamageByEntityEvent)event).getEntity() instanceof Wolf) {
        plugin.wolves.remove(event.getEntity());
        ((EntityDamageByEntityEvent)event).getEntity().remove();
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    if (event.getEntity() instanceof Player) {
      ((Player)event.getEntity()).teleport(plugin.teamselect);
    }
  }
}