Using integer arithmetic in per chunk spawn amount adjustments results in unexpected behaviour
sam-kirby opened this issue ยท 0 comments
Taking the following example:
{
"mob": "minecraft:cow",
"mincount": {
"amount": 15,
"perchunk": true
},
"result": "deny"
}
This has the unexpected consequence of denying all spawns when less than 289 chunks are loaded. Rather than being per chunk, this is per 289 chunks! This basically means that low population servers and people who reduce their view distance for performance reasons will see no mob spawning.
We intended to use this rule to scale the number of mobs based on either a player's view distance or number of players on a server so that large population servers don't feel empty, whilst preventing lower view distances increasing mob density (as would be the case for per player rules), but the unintended consequence of effectively disabling spawning when using fairly standard view distances renders it unusable.
Floating point arithmetic should probably be used here instead.
It should be noted that the default view distance on a server is 10, requiring 3 players with mostly non-overlapping chunks loaded to raise the number of chunks loaded above the threshold to allow spawning for any rules which have a min count per chunk with result deny.