Home > Features > How Many Lines of Code Are There in Minecraft

How Many Lines of Code Are There in Minecraft

Published:
Splash page in Minecraft that might possibly reflect how many lines of code there are in Minecraft.

If you’ve ever wondered how many lines of code there are in Minecraft, then you aren’t alone. The game contains nearly half a million lines of code. And given the game’s complexity, it makes sense for the number to be massive. But what is the specific number and how did we get there?

How Many Lines of code are in Minecraft?

The accepted answer we have is that there are currently 500,000 lines of code in Minecraft, give or take. But, because most of Minecraft is closed-source, it’s impossible to find an exact number without confirmation from the developers. And even if they gave us a number, it would likely change as new version updates roll out.

But the number 500,000 is for the amount of code you can find on your machine. You see, this figure was arrived at by taking the Java version of Minecraft on your PC and running it through a decompiler to count each line of code.

This means that it doesn’t take into account various other resources that make the game run. Such as any libraries used, server-side code, and any extra packages that the game needs to function. If we take this into account, the game likely has millions or even billions of lines of code.

Example of code used to count the lines of code in Minecraft.
Here is an example of one of the code files in the recently released Minecraft Brigadier library. (Credit: Mojang)

In fact, recently we have been able to play around with some of Minecraft’s inner workings when the devs released an open library called Brigadier as shown above. This gives players some access to the back end of the game. And allows us to see the scope of the game as a whole and how large it can actually be.

Especially when trying to count the lines of code used, as this is just ONE library they’ve released. This means if we take into account all the code used to make the game run (the code we don’t have access to) the game will likely have far more than 500,000.

Splash page in Minecraft that might possibly reflect how many lines of code there are in Minecraft.
The splash page players found in Minecraft might possibly showcase how many lines of code there are in the game. (Credit: Reddit / u/Coolist_Beans)

In fact, it might be close to a number we’ve seen on the splash page of Minecraft in the past, more specifically, the yellow lines of text appear every time you open up Minecraft. These lines are usually just jokes or cool pieces of information. But one of them is quite relevant to our topic of discussion.

The line reads “4,815,162,342 lines of code!”. And if we were to take this as legitimate confirmation and not just a joke, then the game all in all would have over four billion lines of code.

How Decompilers Count Each Line

This concept is quite vague and is still up for debate, as a “line of code” can vary depending on who you ask and what standards you use to measure them. Most metrics simply use every executable line of code that performs some kind of function (Excluding spaces, blank lines, and comments). Which means you’ll run the Java version of the game through a Java decompiler.

Players often use Minecraft’s Mod Coder’s Pack (or MCP) to decompile the game and count the lines of code. And doing so will put you at the 500,000 lines of code mark mentioned above. But as we’ve also noted, that’s just the game file local to you, and not the entire architecture of code used to make Minecraft run.

The version list of MCP that players can use to decompile the game for yourselves.
Players can use MCP to decompile the game and count the lines of code that exist in their local files. (Credit: Minecraft Wiki)

Now that you know how many lines of code are in Minecraft, you may want to learn more about the ludicrous size of the game. Then check out how many blocks are in Minecraft 1.19 for some more massive numbers.

Photo of author

AUTHOR

Avid gamer and passionate writer, I play most games but have a special love for those with a deep lore. From the Souls games all the way to platformers like Hollow knight, I play them all! Oh and (noise alert) I play drums in my free time.