25

I was wondering about how many seeds are in Minecraft(1.8.7) and how it ocuppies so few disk space? I think that there are a lot of seeds per world type, calculating this also for EVERY customized combinations. I am sure that they are over zillions. Can you tell me the number of seeds?

6
  • I am just asking about the number of seeds. For example,if someone plays every world type with every seed and every customized possibility(example:sliders moved by 1 to another direction,I'm sure that someone won't really do that). On how many seeds that person would have played? @Ionic
    – John
    Commented Jul 14, 2015 at 9:44
  • @5pike the characters you input are actually irrelevant. The entire text is hashed into a single value.
    – Elva
    Commented Jul 14, 2015 at 10:00
  • 13
    Minecraft doesn't store every possible world. Worlds are generated randomly, and the seed is used to influence the random number generator (in a predictable way, so that if you use the same seed it makes the same "random" numbers) Commented Jul 14, 2015 at 10:50
  • 8
    The misunderstanding you seem to have is that seeds are something like level passwords in some old-school games - they are not. Instead, each seed simply represents a starting point to generate the whole world, piece-by-piece as needed. So there's no "special", "hidden" seeds - the main point of using a custom seed (apart from entertainment value) is so that you can play on the same map as your friends - you both agree to play in a world with a seed of say HumblePhoenix, and both of you will have the same starting terrain, resources etc.
    – Luaan
    Commented Jul 14, 2015 at 13:22
  • You may want to learn about pseudo random number generators.
    – Raphael
    Commented Jul 14, 2015 at 14:09

7 Answers 7

52
+50

There are 18,446,744,073,709,551,616 (264) possible seeds. All seeds are a number, if letters are entered into the seed box, Java's hashCode() function is used to turn it into a number.

Seeds do not use up much disk space (stored as a long integer, meaning just 8 bytes per world) because only a seed that has been chosen for a world is stored; not all 18 quintillion. When a seed is needed for world generation, a random one is generated from the system clock (or entered manually by the user) and is then stored and used to generate the world.

How many possible worlds can generate, including customization options? Probably more than any computer can calculate given all of the float sliders available in a customized world.


Here's an image showing a randomly generated seed:

enter image description here

-3,010,441,696,458,036,422 is far lower than both -2,147,483,648 and -140,737,488,355,328. This means that seeds use higher than 32 bit and 48 bit signed integer ranges.

10
  • Your edit doesn't add anything useful to your answer. Please revert it and add it as a comment on the answer you believe to be incorrect.
    – Lilienthal
    Commented Jul 14, 2015 at 11:24
  • 4
    Do you have any idea how many world possibilities there actually are? Does the procedural generation actually have an entropy of 64 bits, or is it closer to say 32 bits?
    – Luaan
    Commented Jul 14, 2015 at 13:23
  • 8
    @Lilienthal The other answer was the accepted answer at the time of that edit, so I felt the need to notify OP that the answer they accepted is wrong, and why it is wrong. I'm not trying to be passive aggressive, just make sure people have the right information. If my answer is incorrect, then I'd be happy for someone to write another answer with the correct answer, mentioning why mine is incorrect.
    – SirBenet
    Commented Jul 14, 2015 at 16:03
  • 1
    You say that the number you are showing is "far lower than the -2,147,483,648 that Kevin van der Velden claims is the minimum value" but you also say "Java's hashCode() function is used to turn it into a number." meaning it's just another way to say -140449792, which is not less than -2147483648. Which is true?
    – Jon Hanna
    Commented Jul 14, 2015 at 16:05
  • 6
    @JonHanna I believe hashCode() is only used if the seed entered has letters in it. If you enter "1" into the seedbox, the level seed is just 1. -140449792 does not create the same world as -3010441696458036422.
    – SirBenet
    Commented Jul 14, 2015 at 16:19
20

I originally stated that Minecraft uses Java's default Random class for pseudo-random number generation. Random uses 48-bit seeds.

However, that would imply that the seeds 1 and 248+1 result in the same world, which others have pointed out is not true. So I did some more digging.


Minecraft appears to use Random everywhere except for the biome-generation code. There, it uses its own homespun random generator. From GenLayer.java:

protected int nextInt(int upperBound)
{
    int randVal = (int)((this.chunkSeed >> 24) % (long)upperBound);

    if (randVal < 0)
    {
        randVal += upperBound;
    }

    this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
    this.chunkSeed += this.worldGenSeed;
    return randVal;
}

This is a linear congruential generator with values a = 6364136223846793005 and m = 1442695040888963407. This will indeed produce 264 distinct output streams, and thus there are 264 distinct worlds.

The claim on the Minecraft wiki that "Multiplayer seeds may only have 248 possible values [..] due to using Random.nextLong()" is incorrect. The single-player and multiplayer world generators are not different.


The use of Random everywhere else does mean that some things will be the same between seeds that are off by 248, such as seeds 1 and 248+1. For example, the location of ores should be almost the same between the two (except for ores removed by cave-systems).

Also, the use of per-chunk seeds has some interesting consequences. For example, given the small number of biomes and the large number of chunks, in any given world there is a very high probability that there are two chunks which are exactly the same. Finding those chunks, however, involves math which is beyond me. If anyone is interested in figuring it out, the code for initializing the chunkSeed is

public void initChunkSeed(long chunkX, long chunkY)
{
    this.chunkSeed = this.worldGenSeed;
    for(int i = 0; i < 2; i++)
    {
        this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
        this.chunkSeed += chunkX;
        this.chunkSeed *= this.chunkSeed * 6364136223846793005L + 1442695040888963407L;
        this.chunkSeed += chunkY;
    }
}
9
  • @Texenox: No. The input value must be hashed if it's non-numeric (since the seed must be a number), but if numeric inputs were also hashed, you wouldn't be able to recreate random-seed worlds, since hashes are one-way. So the entire hashing discussion is a red-herring. Commented Jul 14, 2015 at 16:04
  • My accepted answer (and the original question) only concern possible seeds, not possible worlds; both of our answers may be correct. If your answer is the case, shouldn't worlds generated with seeds such as 281474976710657 and 1 be the same? I may be mistaken on this.
    – SirBenet
    Commented Jul 14, 2015 at 16:57
  • 1
    The other bits of the 64-bit seed may be used to initialize a per-chunk RNG or some other parameter, though. Minecraft uses a coordinate-based procedural terrain generation algorithm (so the world generated is independent of which way you travel first), rather than a single algorithm that runs once based on a single Random sequence.
    – Random832
    Commented Jul 14, 2015 at 20:03
  • except that Random.nextLong() uses two iterations of that 48 bit seed. It basically goes Random.nextInt() twice and pushes them together into a 64 bit number. So it is entirely possible to have a 64 bit seed come out of a Random object.
    – corsiKa
    Commented Jul 14, 2015 at 20:48
  • @corsiKa: You are confusing 64-bit output with 64-bit seed. The PRNG will generate many billions of bits before repeating itself, so in a sense, the output is "billions of bits", much more than 64. But the input (seed) is still 48-bits; those 48-bits completely determine what output will be. Commented Jul 14, 2015 at 20:52
6

So the answer is found here: https://minecraft.wiki/w/Seed_(level_generation)

Which even though it's already linked on this page no one seems to have read it all.

To summarize:

If you use a word or phrase then String.hashCode() is called and it limits your maximum amount of seeds to 2^32 because of it's implementation.

If you enter your own number or let the system determine the seed then your seed limit is 2^64 seeds.

HOWEVER:

If it's a multiplayer world they implement the nextLong() java function and the limitations of that are 2^48 possible seed options.

4
  • The last sentence makes no sense. You are conflating multiple issues (the seed to new Random(seed) is only 48-bits, which has nothing to do with "overloading nextLong()) Commented Jul 15, 2015 at 5:07
  • It's String#hashCode() not Java.hashCode(). There is no Java class with a static method hashCode. (Yeah, you could get away with replace the pound with a dot, but I like to be pedantic)
    – anon
    Commented Jul 15, 2015 at 6:54
  • @BlueRaja-DannyPflughoeft I'm not conflating anything I'm merely repeating what the DEVELOPER says on their own wiki page. And I never said anything about "overloading" nextLong(). So argue as much as you want, it doesn't change what the developer says they do. As for the Java.hashCode thing I just typed that up wrong when I was trying to summarize instead of just copy paste. The developer does list it as String.hashCode(). My mistake.
    – Ryan
    Commented Jul 15, 2015 at 15:12
  • The developer does not maintain that wiki page, random users do. It is not an official source of information any more than this page is. Commented Jul 15, 2015 at 15:50
2

Seeds are hashed into a 32 bit signed integer. Which is programmer speak for a number that can be positive or negative, and is 32 values in base 2.

This gives the numbers from -2,147,483,648 to 2,147,483,647.

Depending on the implementation of Minecraft some of those might result in the same world in certain aspects like having 2 seeds with different biomes but the same heightmap.

(Partial) correction: If you don't set a text seed minecraft will instead take the current time as it's value, which is a 64 bit number so there are more options there.

Source: https://minecraft.wiki/w/Seed_(level_generation)

6
  • If Minecraft replaces a string seed with current time, how come I always get the same world for seed "SEED"?
    – Orc JMR
    Commented Jul 14, 2015 at 10:56
  • Is there a specific logic that prohibits entry of numbers longet than 32 bits? You are saying that the game can handle 64 bits of time values, but one can only enter 32-bit numbers manually, right?
    – Orc JMR
    Commented Jul 14, 2015 at 10:57
  • @OrcJMR it doesn't replace the string seed with current time, if you don't set it then it'll use the current time. That's also why you can't insert a 64 bit value via the text field. It'll convert that text (via one way hash) to a 32 bit number. If you want to specify an arbitrary number you can edit the map file and delete the generated chunks and then start the game I suppose.
    – Elva
    Commented Jul 14, 2015 at 11:07
  • @KevinvanderVelden if the string entered is numeric it gets parsed into a long and used as the seed, if it isn't then String.hashCode gets used. Commented Jul 14, 2015 at 11:42
  • 1
    Oh, my bad, reading fail on that time issue. But I've already got to the game and tested: i.imgur.com/x0fMiR3.png It is definitely possible to enter 64-bit integers, like those OVER 9 BILLION.
    – Orc JMR
    Commented Jul 14, 2015 at 12:02
1

The number of seeds isn't limited by the application itself. Just by the length of the allowed value for the seed itself.

The seeds won't be stored into Minecraft. The seed itself will just be some kind of "startvalue" where the world generation starts it generate process. There isn't a seed for every world inside the game itself. You'll only get the same world as the generation process would run and generate the same world due to the same start conditions.

You can compare it by counting the steps from your way home to your work. If the same condition applies every day the same way will be used. If it snows one day or if you stay up a bit later on the day the start condition is different and your going to take another way or another time to your work. But if the same different condition would apply on another day it will end the same way. Just as an example to clarify it for the non-techies. :-)

1

Computers do not truly generate random numbers. When fetching a random number, it just gives you the next number in a sequence of seemingly random numbers (they have no pattern or connection to each other).

A seed is what truly randomizes this list of numbers, in most cases, the current system time will be used as a seed. You could think of a seed as a way to get the same random result repeatedly.
The way a Minecraft world is generated is by an algorithm that repeatedly fetches random numbers such as when to increase surface height, etc...

Using seeds, these random numbers will be the same each time, which results in a world being the same when the same seed is used.
That being said, seeds do not take up disk space because they are simply a way to scramble/randomize the list of seemingly random numbers.

2
  • Well, It actually picks one of the seeds based on the time your computer is set at. Commented Jul 15, 2015 at 4:48
  • 1
    More importantly, this did not answer the question that was asked.
    – Synetech
    Commented Nov 27, 2015 at 21:55
-1

1.2413916e+61

apparently this it is a very big number but 48x! would be the answer

1
  • 2
    This answer would be a lot better if you explained where those numbers are coming from - what is 48! supposed to represent? As of right now it looks like this is completely wrong.
    – Mage Xy
    Commented Sep 2, 2016 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.