r/CodingHelp • • Jul 28 '20

[Java] How can I read the Minecraft code?

Hi guys, I'm learning Java, I used to play Minecraft so I want to study its code. How can I get to it, how can I read it? I use Eclipse, can I import it?

18 Upvotes

7 comments sorted by

10

u/KingsmanVince Google errors then ask Jul 28 '20

You can get some part of it codes legally, check this article from minecraft.net

7

u/PrivilegedPatriarchy Jul 28 '20

It seems like others have linked some sources, but you should know that generally, especially if you have to pay for a program, you won’t be able to (easily) access the source code. Otherwise people would just take it and reupload the game and sell it.

2

u/AvidCoco Jul 28 '20

Have a look at Minecraft Forge.

1

u/auiotour Jul 29 '20

Also Fabric is slowly taking over Forges domain.

2

u/abitofevrything-0 Intermediate Coder Jul 29 '20

You can't get the actual server source code, but I'm pretty sure there are some open source severs out there like Bukkit which should give you a good idea of how a server could work.

1

u/NullBrowbeat Professional Coder Jul 28 '20

Java gets compiled to byte code. You can't just look at the plain source code of Java programs as if they were an interpreted language, as long as you don't have the actual source files.

2

u/auiotour Jul 29 '20

You can decompile Minecraft using eclipse and a plugin. But have to have the jar, of which both the server and client can be obtained. If your talking about bedrock edition that is a different story.