
[FEATURE REQUESTS] Option to disable mob/entity on the chunck get pregen
leocorv opened this issue · 1 comments
Description
When using Chunky to pre-generate a world on a Fabric server (Minecraft 1.21.7) with a large radius (e.g., 6000 blocks in diameter) and a high number of simulated players (~100), significant lag can occur after the pre-generation.
The issue is that Chunky loads chunks during pre-generation, which triggers natural mob spawning in those chunks, even if they have not yet been discovered by real players. As a result, after pre-generation, these chunks remain “ready” to contain mobs, and the vanilla engine allows them to spawn, causing a massive entity spike as soon as the game applies its spawning rules. This can create severe lag or even crashes, especially with a large number of players.
Steps to Reproduce
- Install Chunky on a Fabric server (Minecraft 1.21.7).
- Simulate a large number of players (~100).
- Run a pre-generation over a large area (e.g., 6000 blocks in diameter).
- Observe the entity count after pre-generation finishes → large spike of mobs in pregenerated chunks, even if no player has visited them.
Expected Behavior
An option in Chunky to load chunks for pre-generation without running mob spawning, neither during nor immediately after, until a player has discovered those chunks.
Simple Proposed Code Change:
When calling the method that loads the chunk for pre-generation (e.g., world.getChunk(x, z, ChunkStatus.FULL, false)
or its Fabric equivalent), add a parameter or option to temporarily disable entity population for that chunk.
This could be implemented by using a chunk loading method that does not trigger the EntityPopulation
phase, or by disabling doMobSpawning
just while loading the chunk. (These are just ideas and possible approaches.)
Additional Information
- Minecraft: 1.21.7
- Platform: Fabric 0.16.14
- Chunky: Chunky-Fabric-1.4.40.jar
If you need more informations or precisions send me a message on discord :
nerix_
Chunky does not make any modifications to vanilla chunk generation. This is done specifically for compatibility reasons (e.g. to support a range of mods and modpacks). As such, this is likely out of scope for the project.
I also don't quite believe this is a real issue. Mob spawning does occur as part of world gen, but these mobs are dormant until the chunk is loaded again. Chunky doesn't even tick them while generating. I would need to see evidence that suggests otherwise.
Most likely, the issue is with the 100+ players simulated (and the mobs in those chunks), and not with chunk generation. This can be improved using built-in game rules (to disable mob spawning), using other optimization mods, etc.
Feel free to join the chunky Discord if you want to discuss this more, but at the moment, marking as not planned.