[SPIGOT-3287] Mob spawn cap mechanic totaly broken Created: 03/Jun/17  Updated: 03/Jun/17  Resolved: 03/Jun/17

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Lasse S. A. Assignee: Unassigned
Resolution: Invalid Votes: 0
Labels: Spigot, entity

Plugin: no plugin, spigot feature

 Description   

I marked this as a bug, even though i think its an intended mechanic within spigot, and it baffles me why it is so. 

Right now, it seems you have a total mobcap, world wide (world, nether, end etc is separated, indeed this is a good thing)

but, when it comes to the mechanic itself, its kind of broken. we are a small server, we tend to be max 3-5 players on, many afk over night etc. 

So the way mobs spawn now, as i said, a total mobcap, you set your cap, thats it. at least this is how i see it, ive done no counting of enteties, but i can see it with my bare eyes what the problem is.
its not just affected by people standing afk, it could be a person mining, hugging all the mobcap, this hurts people with mob farms greatly. we, who have been running around torching everything, to optimize our spawn rates, gets hurt by this.

as an example, i am in a mushroom biome, a large island where no mobs can spawn. in that island is a squared spot, this spot is an ocean biome. clearly i made this my darkroom mobfarm, because i would not need to torch anything, everything where optimized from the start. if im online alone, or with others with optimized farms, this works great, but as soon as someone logs on, that is not killing off mobs, they start to hug the whole mobcap, to the point where there are NO mobs spawning in our mobfarms.

as i said, im not that technical, but a solution would be to at least let people set a player pr player mobcap, and a separate total mobcap for the whole world.

lets say, i set 500 as the total mobcap in the settings. then 50 mobs max pr player. there would be max 50 mobs around me at any given time, even though the mobcap is set to 500.
player 2 comes on, he spawns 50 mobs, now there will be 100 active mobs at any given time. if lets say we then exceed 11 players, now we have reached the total mobcap, and now only 45 mobs can spawn pr player, and already spawned mobs that are over the now new mob cap de spawns to count for this. 

Totaly ok to have your defaults as is, but let me be able to change player pr player mobcap, or at least let me set it to vanilla spawning mechanics. 

increasing the total mobcap does not help, it reatches total mayhem, and still one player can hug the whole mobcap.

we now have a scheduled task killing off common mobs every 10 minutes, i don't want to do this, but this is the only way we can have some mobs spawn in our farms.

this breaks the game and the SMP feel we all love so much



 Comments   
Comment by md_5 [ 03/Jun/17 ]

The maximum amount of mobs that will spawn on the server is approximately 0.24 * chunks loaded by default (in vanilla also). "New chunks" are not preferential to mob spawning in any way.
You are right in the sense that if one particular player amasses 0.24 * chunks loaded mobs within his own radius, then no further mobs will spawn on the server. This doesn't seem overly likely however. You are comparing your assumptions on Spigot with a player farming mobs to then just a single player on Vanilla. If you set spawn-range to 8 and compare identical environments betweeen vanilla and spigot I think you will find very little difference.

Comment by Lasse S. A. [ 03/Jun/17 ]

Then i have been totally mislead by what I've been reading in different forums, and for that i apologize. from what i have heard, spigot uses another algorithm. 

our players are not clustered, they are spread out. and the mobcap is not reached because of spawners. we where at one point 3 players on the server. 2 of the players have optimized mob farms and areas suited for this. the third player stands afk. these are also 3 totally separate locations.

both mobfarms of the 2 first players stops spawning mobs completely. i then moved away from this area, in to an area where mobs should spawn naturally (loading new chunks) no mobs, it was like playing on peaceful setting. this is something i have never experienced when running vanilla server. when i went ahead to check the player standing afk, there were a huge amount of mobs around him and the surrounding caves. thus making me believe he is hugging the total mobcap (still, with only naturally spawned mobs)

if this do not sound like a bug, then again i apologize. as i have stated earlier, i am not so technical that i can point at any code to validate my assumptions. my assumptions where taken from past experience with vanilla, and discussions I've had with people on different forums. 

Comment by md_5 [ 03/Jun/17 ]

What Spigot feature are you trying to say is the issue?
The only difference is Vanilla will always spawn mobs in an 8 chunk area around a player, whereas Spigot will allow configuring this value (and defaults it to 4 chunks, and doesn't allow it to go larger than view distance).
By default Spigot will cluster mobs more closely to players as a result of this, but it otherwise doesn't change the limits. You seem to suggest in your ticket that there is some sort of "total mob cap" setting, but this is not the case. Maybe you are referring to spawn limits in bukkit.yml? Well those settings are just configurable values to what is hard coded in Vanilla. Those limits are also not for the entire world, they are scaled according to a Vanilla algorithm: (limit * chunks / 17^2). More players joining and loading more distinct chunks will raise the limit accordingly. Maybe you have players all clustered in the same set of chunks?

I'm not sure where you get this idea that Spigot enables players to "hug the total mob cap" any more than Vanilla - can you point to any code that validates your assumptions? Vanilla has nothing to take into account mob limits either aside from the spawn limits I mentioned earlier.
If you want mobs more widely distributed, then spawn-range is the option you want, but really I cannot tell from your description where/how you think Spigot is different.

Generated at Tue Apr 22 05:57:09 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.