Mojira Archive
MC-2788

Sheep wool color doesn't generate/randomize properly; generating villages resets world RNG

Sheep groups spawning at world generation or otherwise when structures are generated at the same time will spawn the same sheep colors.

Steps to reproduce:

  • Find a world where a lot of sheep spawn at world generation. Ideally spawn near a plains biome. Example seeds are "136" and "quarry" (default biomes)
  • Observe sheep

Actual results:

  • The sheep spawning in groups of 4 always spawn with the same color. In the "quarry" seed, sheep will always spawn as three white sheep and one brown sheep. In the "136" seed, sheep will always spawn as three white sheep and one dark grey sheep.

Expected result:

  • Sheep should be randomized so you get different sheep per group per world.

The code that generates groups of sheep (and possibly other mobs) doesn't seem to use the random generator properly so all the sheep groups are generated the same. See comments for details and attachments for debug output.

Note: This bug probably applies only to mobs spawning while structures are generated at the same time, if you search long enough, you may/will find different sheep groups.

PS: Additionally, some seeds like "135" spawn huge amounts of pigs but no sheep, so it may be possible that the random generator fails to be random even earlier: At determining which mobs to spawn.

Code analysis

See this comment by Markku