Tutorial: See Minecraft's code
The main game executable of Minecraft: Java Edition is a client.jar file containing Java bytecode designed to be ran by Java Virtual Machine (JVM). Because of how Java is compiled, there is enough information stored in the bytecode which makes it possible to turn it back into source code. This process is called decompilation (as oppose to compilation). However, the resulting decompiled code may be obfuscated, which contains cryptic class or method names that are meaningless. To fix this, it must undergo deobfuscation through JAR remapping, which is a process for the JAR file that replaces obfuscated class names and member names with their readable (deobfuscated) names provided from an obfuscation map. This process is usually done before decompiling the JAR file to produce a human-readable Java source code.
Historically, the game has been reverse-engineered and well understood by the community, that custom obfuscation maps are typically provided for use in developing mods.[1] However, since the release of Java Edition 19w36a, Mojang Studios have released official obfuscation maps for versions of Minecraft since Java Edition 1.14.4. It's safe to assume these obfuscation maps contain the names written during the development. When these maps are used in tandem with decompilation, the game's bytecode can be successfully reconstructed into human-readable Java source code. Since Java Edition 26.1 (Snapshot 1), the game has been deobfuscated by default, but will still need to be decompiled in order to see the readable source code.[2]
There are many benefits of seeing the game's source code, one of them is that you can analyze how the game's various mechanics work directly by seeing the code, which contains instructions and rules making them up. The source code of the game is also heavily involved and used in developing mods, an unofficial extension of the game typically made by the community that adds new content, progression, and mechanics.
Complete article available
This cached Wiki page is unusually large, so it is loaded on demand to keep the initial page fast.