mojira.dev
MC-168748

Rapid cod spawning and despawning causing performance issues

Similar to MC-134696 but I was told to create a new issue.

The bug

Cods can rapidly spawn and despawn. They don't respect their cap. This can cause 400+ cods to spawn, dropping the server performance. 

This happens more regularly when moving into unloaded chunks, but this is not always required. After a minute the numbers go back down. I printed the number of cods in chat every 10 seconds and attached a screenshot with the results. 

How to reproduce

  1. Load chunks near an ocean where cods spawn.

  2. Cods should start spawning immediately.

  3. /execute if entity @e[type=cod] shows how many cods are loaded. In my testing this could be as high as 500 entities.

  4. Notice the server performance has dropped significantly.

Linked issues

Attachments

Comments 3

It's pretty interesting. /kill @e[type=!player] while being at an ocean and then doing /execute if @e[type=cod] -> over 600 entities.
Sit around for a while, most of them despawned, only 29 left for me.
Moving around might spawn enormous amounts again.

From the 20w10a changelog:

Fish now despawn when further than 64 blocks away from the closest player

So, this should be fixed now?

It does indeed appear that fish spawning is much more stable now. I can still get 110+ cods spawning, this may be acceptable. The number of cod also stabilizes after a while instead of fluctuating drastically.

So I'd say that this is fixed.

Misode

(Unassigned)

Confirmed

Very Important

Mob spawning, Performance

1.15.1, 1.15.2, 20w06a

20w10a

Retrieved