Set a Total Mob Cap for Your World
Locate the Global Limit Setting
Open your configuration file and find the ["Mob Blocking Settings"] section. The allMobsLimit value controls the maximum number of mobs that can exist in your entire world at once.
Choose Your Cap
The default is set to a specific number. Lower this value if you experience lag with many mobs present. Higher values allow more mobs but consume more resources. Consider your system's performance when deciding.
Enable Mob Blocking
Ensure enableMobBlocking = true in the same section. Without this enabled, the global cap won't function.
Understand the Behavior
Once the cap is reached, new mobs will not spawn until existing mobs die or despawn. This prevents mob counts from spiraling out of control during grinder operation or in high-spawn biomes.
Test and Adjust
Restart your game and monitor performance. If lag persists, lower the cap further. If you want more mobs, increase it gradually and test.