How does animal spawning work?

In what way do animals in Minecraft spawn? It looks to me that they spawn more during the night (but where there are torches) and more kind of around you / around some other human player. Am I right, or does it work some other way?

Thank you.


The Minecraft Wiki shows that there are many variables that affect animal spawnings as of version 1.3.2.

One in ten newly generated chunks will contain mobs (includes any animal, monster, or utility). They can show up in as many as four 'packs' of the same mob. They will always spawn on the highest point (the blocks that you see if you were flying). Therefore, if the world generator had to choose between spawning an animal on a ledge or inside a cave, it would choose the ledge. The block that the animal spawns on must be opaque (not glass, water, lava, etc).

Pigs spawn in groups of either three or four. Sheep spawn in groups of two to eight. Cows spawn in groups of four, and can spawn up to twelve. Chickens spawn in groups of as much as three. When chicken eggs are thrown, there is a 1/8 chance of a baby chicken spawning. There is also a 1/32 chance of four spawning instead of one. Before version 1.6, they only spawned when the light level was over nine, now they spawn regardless of whatever light level.


The block two blocks above the opaque block must be non-opaque (tree leaf, water, lava, glass). Animals (excluding squid) do not spawn in ocean biomes. No animals normally spawn in desert biomes. The spawning of animals is dependent on the world seed. This means that if I make a world with default settings and the seed 'minecraft' and you do that same, the cows and pigs will spawn in the exact same places.

Very rarely, new animals can spawn in already generated chunks, like monsters. When this happens, as well as when mobs spawn from a mob spawner, the following rules apply:

  • The light level must be nine or more.
  • The opaque must be a grass block (not a dirt block).

Unlike monsters, animals do not spontaneously despawn, except for wild ocelots and wolves (which can despawn only when they are hostile). They do not despawn even if the player is far from them.

Note that squids have different spawning criteria then other mobs. They can spawn at any light level underwater. They will also spawn in player made pools and sometimes they will spawn in underground water deposits. It is technically possible for them to spawn in one block of water, but that is not very likely.


Prior to version 1.6, all ground passive mobs (not squid) will spawn at light level 9 or above on grass blocks. From version 1.6 onwards they will spawn on grass at any light level. Squid will spawn at any light level under water.

Groups:

  • Pigs spawn in groups of 3-4
  • Sheep spawn in groups of 2-8
  • Cows spawn in groups of 4-12
  • Chickens spawn in groups of 1-3 (and a 1/8th chance from a thrown egg)

In Addition: Animals, and Monster-Mobs too, ONLY Spawn a few 100 blocks around human Players. Animals only Spawn on dirt blocks and cobble stone