Cancel damage to players by pets.
This is technically not necessary when pets are simple entities like wolves and zombies, because these types of pets will never target and thus attack other players in the arena. However, projectile entities such as Blazes and Ghasts may hit players in the line of fire, and so any such damage should be cancelled. Fixes #712
This commit is contained in:
@@ -731,6 +731,12 @@ public class ArenaListener
|
||||
}
|
||||
|
||||
if (arena.inArena(player)) {
|
||||
// Cancel damage from pets (and their projectiles)
|
||||
if (monsters.hasPet(damager)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// Cancel PvP damage if disabled
|
||||
if (!pvpEnabled && damager instanceof Player && !damager.equals(player)) {
|
||||
event.setCancelled(true);
|
||||
|
||||
Reference in New Issue
Block a user