Earth2Java [FORGE]

Earth2Java [FORGE]

21.3k Downloads

Setting spawn chance to 0 causes world gen crash

PssbleTrngle opened this issue ยท 0 comments

commented

Target Version
Mod Loader: Forge 32.0.108
Minecraft Version: 1.16.1
Mod Version: 2.2.0

Describe the bug
When setting the spawn chance of a hostile mob (the spider or the wolf) to zero, world generation can crash,
because they are still added as an spawn entry with a weight of zero. If there is a biome with no other spawnables monsters, which happened to me, the generator tries to get a random spawnable mob because the spawn entry list is not empty, but crashes with an IllegalArgumentException because the total weight of the spawn entry list is zero.

I know the config states that the weight should be above zero, but it is not checked if the player does otherwise.
I would recommend printing a warning if the player does so and most importantly, not adding a spawn list entry for a mob if the weight is set to zero.