Only allows mobs to target each other if infighting is enabled. Fixes #364

This commit is contained in:
Andreas Troelsen 2017-03-13 21:12:16 +01:00
parent da094e0f57
commit 98d3cf0245

View File

@ -856,6 +856,11 @@ public class ArenaListener
else if (event.getTarget() instanceof Player && !arena.inArena((Player) event.getTarget())) { else if (event.getTarget() instanceof Player && !arena.inArena((Player) event.getTarget())) {
event.setCancelled(true); event.setCancelled(true);
} }
// And other mobs unless infighting is enabled
else if (monsters.getMonsters().contains(event.getTarget()) && !monsterInfight) {
event.setCancelled(true);
}
} }
} }