}
boolean tamedWolf = ent instanceof Wolf ? ((Wolf)ent).isTamed() : false;
ClaimedResidence area = Residence.getResidenceManager().getByLoc(ent.getLocation());
/* Living Entities */
if (event instanceof EntityDamageByEntityEvent) {
EntityDamageByEntityEvent attackevent = (EntityDamageByEntityEvent) event;
Entity damager = attackevent.getDamager();
ClaimedResidence srcarea = null;
if (damager != null) {
srcarea = Residence.getResidenceManager().getByLoc(damager.getLocation());
}
boolean srcpvp = true;
if (srcarea != null) {
srcpvp = srcarea.getPermissions().has("pvp", true);
}
ent = attackevent.getEntity();
if ((ent instanceof Player || tamedWolf) && (damager instanceof Player || (damager instanceof Arrow && (((Arrow)damager).getShooter() instanceof Player)))) {
Player attacker = null;
if (damager instanceof Player) {
attacker = (Player) damager;
} else if (damager instanceof Arrow) {