MCA Reborn [Fabric/Forge]

MCA Reborn [Fabric/Forge]

6M Downloads

Villagers all die because my world is more dangerous, setting "guardSpawnRate" does NOTHING

JetpackRescue opened this issue ยท 2 comments

commented

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.

commented

As user mentioned in discord, this is on 1.16.5

commented

@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.