Hostile Villages[Forge/Fabric]

Hostile Villages[Forge/Fabric]

2M Downloads

Editing "vanillaVillageChance" does not accurately reflect hostile village spawn percents.

Kalikars opened this issue · 1 comments

commented

Describe the bug
Editing the int value for "vanillaVillageChance" to be above 0 along with "allowVanillaVillagerSpawn" = true in the config does not accurately reflect the percentage chance for villages to spawn.

To Reproduce
Steps to reproduce the behavior:

  1. Use these configuration files (remove _ from file name): Gist Link
  2. Create a new world (random seed, default options, creative).
  3. Use /locate village and teleport to village, check if hostile, /tp ~ ~ ~1000, and repeat x10.
  4. Shut down minecraft, swap config files, repeat step 2-3 for each config.

Expected behavior
✔With value = 0: Vanilla villages should never spawn. This config value works as intended.
❌With value = 50: Vanilla villages should spawn 50% of the time. In my testing, vanilla villages spawned 12/12 times (expected: 6/12).
❌With value > 0: Vanilla villages should sometimes spawn, with smaller values making this less likely. At value = 1, vanilla villages spawned 0/10 times (expected: 0.1/10, so this works as intended). At value = 10, vanilla villages spawned 8/10 times (expected: 1/10).

There may be a mathematical error with the way percent values are calculated that are making larger values much more heavily weighted than they should be. It may be beneficial to change the native config value to a double and utilize it that way instead of casting as an int.

Mod version
hostilevillages-3.0-1.16.5

commented

fixed in 3.1