mojira.dev
MC-2536

View distance affects mob spawning

Reported on forum: http://www.minecraftforum.net/topic/1541173-java-memory-and-minecraft/#entry19026273

Apparently, the server "view distance" setting, which affects how many chunks are sent to the client for rendering, also affects mob spawns.

What I expected: Just like in single player, under normal circumstances the server would have radius 9 chunks loaded (radius 2= tiny render distance, radius 4=short, radius 8=normal, and load a 9th chunk out so that block ticks can affect stuff into that next chunk), and would have game effects and mobs working in that range, regardless of how many chunks were being sent to the client. Equally, if I had view distance of 15, then my clients can use "far", and things would still behave normally.

While working on server performance, memory/GC tuning, etc, I had a typo recommendation of 7 chunks instead of 9. And I got a response from someone that this severely affected mob spawns.

What I see as the bug: View range โ€“ chunks sent from server to client for display โ€“ should be independent of game effects โ€“ effects are within 9 chunks, as mobs should despawn if loaded and more than 127 from a player, and a block 8 chunks away might tick and update into that 9th chunk. This should hold true whether only 4 chunks are sent to clients (overloaded network upload speed), or 15 chunks (lots of memory, bandwidth, and far vision support)

Linked issues

MC-761 SMP Spawn Rates Resolved MC-1463 Monsters not spawning Resolved MC-1971 High altitude mob spawning inconsistencies Resolved MC-2767 Mob cap abnormally low on SMP Resolved MC-3157 Hostile mobs spawn significantly less when a player has moved far from the spawn in SMP. Resolved

Attachments

Comments 79

To clarify, in what way does the view distance affect mob spawning?

As reported http://www.minecraftforum.net/topic/1541173-java-memory-and-minecraft/#entry18994172 and http://www.minecraftforum.net/topic/1541173-java-memory-and-minecraft/#entry19026273 mob spawns will be reduced if the view distance is reduced.

According to the wiki, the number of valid chunks is tossed into a formula to determine mob caps; my first curiosity is whether or not view distance affects the number of chunks used in that formula.

Confirming this bug, after our host changed the view distance down, we all started getting reduced mob spawning around us, to the point of no mobs spawning, even when there was caves around.

I only got entities flickering between 0/4-5 today while standing in the middle of a dark swamp at night time. This is with server view setting 7 with three players online.

But with setting 10, in the same spot, I got 160 with three players online

I would also like to confirm this bug. The server I have been playing on was getting very few natural mob spawns (1-2entities after standing around), after I suggested increasing the view distance to 9, the spawning behaved as normal (up to 79 entities when standing around)

This would be amazing if it was fix it has been a problem since mid beta... ๐Ÿ˜ž

69 more comments

Can confirm in 23w03a

Can confirm in 23w05a

Can confirm in 23w06a

Minecraft386882

Confirmed in 1.21.3

etanaratsastaja

Given the past years of changes to mob spawning, how much of this is still an issue? Could you update the ticket based on how it works in 1.21.4+?

Keybounce

(Unassigned)

Community Consensus

Platform

Important

Mob spawning

multiplayer, server

Minecraft 1.4.2, Minecraft 1.4.6, Minecraft 1.5.1, Minecraft 1.5.2, Minecraft 1.6.2, ..., 1.19.3, 23w03a, 23w05a, 23w06a, 1.21.3

Retrieved