Add world configuration setting: chunks.mob-spawning-disable-radius-around-spawn-chunk
#13110
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PSA: This is a duplicate of #13108 - I didn't know that making it my new main branch and deleting the old one would cause the original PR to be closed. Sorry - I hope it is acceptable to open this new one. It is exactly the same.
This is my first PR, so I apologise in advance if it is inherently flawed, but it seems to work fine in my testing.
This setting aims to solve the problem that servers with protected regions around their world's spawn point will probably have, where said regions may disable mob spawning via a WorldGuard flag for example, and as a result, the server will continuously try to spawn mobs there, never being able to meet the mob caps due to the cancelled spawns, potentially wasting a considerable amount of time per tick.
It allows you to set a square radius, in chunks, around the world's spawn chunk (by spawn chunk, I just mean the chunk that the world's spawn point happens to be inside). The chunks within this radius will not be considered for mob spawning.
-1
(default) or lower, the feature will be disabled (vanilla behaviour).0
, only the spawn chunk will not be considered for mob spawning.0
, a square radius of chunks around the spawn chunk will all not be considered for mob spawning.Solves #13107