Villagers all die because my world is more dangerous, setting "guardSpawnRate" does NOTHING
JetpackRescue opened this issue ยท 2 comments
I set guard spawn rate to 100, most of the village is jobless or a nitwit. Why aren't there guards? Every single villager dies in all my villages because there's hostile mobs during the day.
@JetpackRescue guardSpawnRate is meant to be a lower number, as it isnt treated by a percentage
int guardCapacity = getPopulation() / Config.getInstance().guardSpawnRate;
// Count all unloaded villagers against the guard limit
// This is statistical and may not be accurate, but it's better than nothing
guards += Math.ceil((getPopulation() - guards - citizen) / (float)Config.getInstance().guardSpawnRate);
// Spawn a new guard if we don't have enough
if (nonGuards.size() > 0 && guards < guardCapacity) {
VillagerEntityMCA villager = nonGuards.get(world.random.nextInt(nonGuards.size()));
villager.setProfession(guards % 2 == 0 ? ProfessionsMCA.GUARD : ProfessionsMCA.ARCHER);
}
This is how the guard spawning is calculated.