Event.Result canSpawn = ForgeEventFactory.canEntitySpawn(spawnedEntity, worldServer, ssX, ssY, ssZ);
if (canSpawn == Event.Result.ALLOW || (canSpawn == Event.Result.DEFAULT && spawnedEntity.getCanSpawnHere())) {
worldServer.spawnEntityInWorld(spawnedEntity);
if (!ForgeEventFactory.doSpecialSpawn(spawnedEntity, worldServer, ssX, ssY, ssZ)) {
unusedEntityLivingData = spawnedEntity.onSpawnWithEgg(unusedEntityLivingData);
}
}
attemptedSpawnedMobs++;
} catch (Exception e) {
Log.warning("Failed to spawn entity " + creatureClass, e);