@EventHandler public void onTarget(EntityTargetEvent event) { EntityUtil entity = (EntityUtil) event.getEntity(); if (entity.checkInVillage()) { event.setCancelled(true); } }
@EventHandler public void onMobSpawn(EntitySpawnEvent event) { EntityUtil entity = (EntityUtil) event.getEntity(); if (entity instanceof Player) { } else { if (entity.checkInVillage()) { event.setCancelled(true); } } }