Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-2788

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

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • Minecraft 1.4.2, (39)
      Minecraft 1.4.4, Minecraft 1.4.6, Minecraft 1.4.7, Snapshot 13w02a, Snapshot 13w05b, Snapshot 13w06a, Snapshot 13w07a, Snapshot 13w09a, Snapshot 13w09b, Minecraft 1.5, Snapshot 13w11a, Minecraft 1.5.1, Minecraft 1.5.2, Snapshot 13w17a, Snapshot 13w18a, Snapshot 13w18b, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.6.4, Minecraft 13w38c, Minecraft 13w42a, Minecraft 13w42b, Minecraft 13w43a, Minecraft 1.7, Minecraft 1.7.4, Minecraft 14w05b, Minecraft 14w06b, Minecraft 14w07a, Minecraft 14w08a, Minecraft 14w17a, Minecraft 14w19a, Minecraft 14w21b, Minecraft 1.8, Minecraft 1.8.1-pre3, Minecraft 15w41b, Minecraft 15w47b, Minecraft 1.9.4, Minecraft 1.10.2, Minecraft 1.11.2
    • Confirmed
    • World generation

      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 bugi74

        1. 2012-11-11_13.58.25.png
          2012-11-11_13.58.25.png
          1.41 MB
        2. 2012-11-11_14.14.17.png
          2012-11-11_14.14.17.png
          1.61 MB
        3. 2012-11-11_14.14.24.png
          2012-11-11_14.14.24.png
          1.31 MB
        4. 2012-11-11_14.14.39.png
          2012-11-11_14.14.39.png
          2.36 MB
        5. 2012-11-11_14.14.51.png
          2012-11-11_14.14.51.png
          1.78 MB
        6. 2012-11-11_14.15.11.png
          2012-11-11_14.15.11.png
          1.62 MB
        7. 2016-06-29_12.36.37.png
          2016-06-29_12.36.37.png
          2.55 MB
        8. random.txt
          2 kB
        9. sheep-console-spam.txt
          9 kB

          [MC-2788] Sheep wool color doesn't generate/randomize properly; generating villages resets world RNG

          [Bot] Arisa added a comment -

          This report is currently missing crucial information. Please take a look at the other comments to find out what we are looking for.
          If you added the required information and a moderator sees your comment, they will reopen and update the report. However, if you think your update to this report has been overlooked or you want to make sure that this report is reopened, you can contact the Mojira staff on Discord or Reddit.
          – I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit

          [Bot] Arisa added a comment - This report is currently missing crucial information. Please take a look at the other comments to find out what we are looking for. If you added the required information and a moderator sees your comment, they will reopen and update the report. However, if you think your update to this report has been overlooked or you want to make sure that this report is reopened, you can contact the Mojira staff on Discord or Reddit . – I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit

          Is this still an issue in 1.14.4 or above?

          [Mojang] slicedlime added a comment - Is this still an issue in 1.14.4 or above?

          You don't have to find the sheep, just give them the glowing effect. I found one group with a dark grey sheep, like in the report, and another one without a grey sheep.

          Fabian Röling added a comment - You don't have to find the sheep, just give them the glowing effect. I found one group with a dark grey sheep, like in the report, and another one without a grey sheep.

          Markku added a comment - - edited

          White is too common color, so that can not be used to check this one. It is best to check the seeds and locations already mentioned, but also note that world generation changes can make the earlier seeds/locations to no longer give the same results.

          The best indication is to find a group with sheep(s) of rarer color(s), and see if the same color distribution is found in other groups nearby. E.g. if multiple groups all have 3 whites and one black, it could be an indication of this bug still being in effect. Typically, one would first find a world with a nice amount of sheep groups close together, then recreate the world with the same seed, but teleport right in the middle of those sheep groups (so they get generated in the same generation "run"). But just flying around in creative might do the trick, too.

          Markku added a comment - - edited White is too common color, so that can not be used to check this one. It is best to check the seeds and locations already mentioned, but also note that world generation changes can make the earlier seeds/locations to no longer give the same results. The best indication is to find a group with sheep(s) of rarer color(s), and see if the same color distribution is found in other groups nearby. E.g. if multiple groups all have 3 whites and one black, it could be an indication of this bug still being in effect. Typically, one would first find a world with a nice amount of sheep groups close together, then recreate the world with the same seed, but teleport right in the middle of those sheep groups (so they get generated in the same generation "run"). But just flying around in creative might do the trick, too.

          I'm not too familiar with this bug, but I just found a pack of four white sheep in the "136" seed. Does that mean it's fixed?

          Fabian Röling added a comment - I'm not too familiar with this bug, but I just found a pack of four white sheep in the "136" seed. Does that mean it's fixed?

          Matthew added a comment -

          Is this still an issue in 1.13-pre5?

          Please keep the ticket updated.

          Matthew added a comment - Is this still an issue in 1.13-pre5? Please keep the ticket updated.

          This is seed 136 in 1.10.2. At spawn I didn't immediately discern a pattern although many groups were the same. Near a village ALL groups were 2 white + 2 black. The debug screen shows these coordinates: 634, 118, 112. Generating a new world and teleporting there reproduces it.

          I also disassembled the game using javap and found the mechanism is still in place. Village generator sets the world's RNG to a particular value. Sheep uses the world's RNG to pick a color. ??? Profit!

          jonathan2520 added a comment - This is seed 136 in 1.10.2. At spawn I didn't immediately discern a pattern although many groups were the same. Near a village ALL groups were 2 white + 2 black. The debug screen shows these coordinates: 634, 118, 112. Generating a new world and teleporting there reproduces it. I also disassembled the game using javap and found the mechanism is still in place. Village generator sets the world's RNG to a particular value. Sheep uses the world's RNG to pick a color. ??? Profit!

          Try a more recent seed and try to find sheep groups that are near each other (ie generate at the same time). I'd try the seed and coordinates by Vitold but I'm curently away from home so I can't try reproducing this.

          Jonathan Haas added a comment - Try a more recent seed and try to find sheep groups that are near each other (ie generate at the same time). I'd try the seed and coordinates by Vitold but I'm curently away from home so I can't try reproducing this.

          Just opened seed 136 in 1.10.2. First group of 4 sheep I found was two white, one light grey, one dark grey. Second group of 4 sheep I found was three white and one light grey. These groups were far away from each other and I made sure (with glowing effect) that I didn't confuse sheep of different groups. Does that mean fixed for 1.10.2?

          Fabian Röling added a comment - Just opened seed 136 in 1.10.2. First group of 4 sheep I found was two white, one light grey, one dark grey. Second group of 4 sheep I found was three white and one light grey. These groups were far away from each other and I made sure (with glowing effect) that I didn't confuse sheep of different groups. Does that mean fixed for 1.10.2?

          Vitold Chernatinski added a comment - - edited

          Still Reproducible in 1.9.4
          Seed: 2368284
          x: 1941
          z: 5825
          Look for pink sheep.

          Vitold Chernatinski added a comment - - edited Still Reproducible in 1.9.4 Seed: 2368284 x: 1941 z: 5825 Look for pink sheep.

            Unassigned Unassigned
            jonathanhaas Jonathan Haas
            Votes:
            18 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: