Alex's Mobs

Alex's Mobs

72M Downloads

All spawn chances might be higher than intended

Mysteryem opened this issue ยท 0 comments

commented

The default alligatorSnappingTurtleSpawnRolls is 1. This rolls value appears to get read from the config and then fed into random.nextInt(rolls) in https://github.com/Alex-the-666/AlexsMobs/blob/bb704abeeec80c7063fc168cf1da7a7e54783115/src/main/java/com/github/alexthe666/alexsmobs/entity/AMEntityRegistry.java#L223 which will always return 0 because the bound of 1 is exclusive and not inclusive, meaning 0 == random.nextInt(1) is always true since the only integer within the bound is 0. This doesn't seem like the intended behaviour since you are already optimising out the nextInt call when rolls <= 0 and treating that like a 100% chance.

The chance of 0 == random.nextInt(rolls) being true is 1/rolls.