The bug
When a mob outside the player's simulation distance dies, it continues to count towards its mob cap until the player moves closer to it where it died. This makes it very difficult to use commands to enable animals to spawn naturally, since running /kill @e[type=!player]
won't actually reset all mob counts to zero.
How to reproduce
Create a new world:
World Type: Superflat
Generated Structures: OFF
"Spawn mobs" game rule: OFF
"Spawn chunk radius" game rule:
0
Set your simulation distance to 5 chunks, and ensure your render distance is higher than that
Spawn a cow
→ ✔ The creature count is1
("C: 1
" on the fourth-bottom line of the debug screen)Teleport 100 blocks away:
/tp ~ ~ ~100
Kill the cow:
/kill @e[type=cow]
→ The command succeeds, but the cow is still visible
Verify that the cow is actually dead:
/execute if entity @e[type=cow]
→ ✔
Test failed
Check the creature count
→ ❌ The creature count is still1
Walk towards the cow
→ The cow's death animation plays
→ ✔ The creature count is now0
Can confirm.
[media].
[media].