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.
Legal disclaimer
[edit | edit source]If you use the official obfuscation mapping from Mojang Studios, note that there is additional license and terms you must follow. According to its license, decompiling Minecraft is allowed, but it is recommended that one does not release decompiled code. Furthermore, a Twitter post from Dinnerbone suggests usage of the mappings inside of projects by the community, such as modding (using them to decompile Minecraft for usage with Forge, NeoForge, Fabric, Quilt and other mod loaders) or for usage in server software with plugins (such as Spigot, Bukkit, Paper, and others) is okay, and an intended use. It should also be noted however that this post is not legally withstanding, so while it is probably fine to use these mappings for such purposes, you do so at your own risk. This can be extended to decompiling and accessing Minecraft's code as a whole; the only things you should not do under any circumstances are releasing the code or releasing something that contains an exact copy of the code.
Decompiling JAR
[edit | edit source]Although the game has been deobfuscated for modern versions (and the official obfuscation map provided for older versions), Mojang Studios does not provide an official documentation nor tutorial to decompile the game and actually see the source code itself. Instead, you would need to use a community tools designed to process the obfuscation map (remapping) and/or decompile the game into a human-readable Java source code. There are numerous ways to do this, all of them vary on the technical levels.
JAR-based tools, such as Vineflower and MinecraftDecompiler, require Java to run, see Tutorial:Update Java § How to download to set it up. They may also only be used as a command-line interface, which you need a terminal provided by your system (on Windows, this is Command Prompt or Windows Terminal; on macOS or Linux, it's typically provided by the same name, Terminal).
mcsrc.dev
[edit | edit source]mcsrc.dev is a web-based tool made by FabricMC authors for viewing the Minecraft's game source code directly inside a web browser. It works by downloading the game's JAR file from Mojang's servers, and decompiling the game directly inside the user's web browser using Vineflower. This results in the game's source code being easily accessible on the website.
The website lets you select Minecraft versions from rd-132211 through c0.0.13a, 1.14.4, and 19w36a through 26.3 Snapshot 10, including Combat Test 4 through Combat Test 8c and April Fools' versions from 20w14∞ through 26w14a. For other versions, you may want to use other methods, such as manually decompiling the JAR using third-party software below.
Vineflower
[edit | edit source]
Vineflower is a modern standalone Java decompiler made by Vineflower authors. It's used to decompile the game into a series of readable Java source code organized with their package structure intact. However, it cannot be used to deobfuscate, and when used on an obfuscated game version, it will produce Java source code with ambiguous cryptic names. It's recommended to use the deobfuscated game versions from Java Edition 26.1, and for older versions, you'd need to manually deobfuscate the game using a JAR remapper tool before decompiling. This process is automatically provided by MinecraftDecompiler, which deobfuscate and decompile with Vineflower, and other decompilers.
Vineflower is derived from Fernflower, the original decompiler made by Jetbrains, and well as numerous community forks, such as MinecraftForge's ForgeFlower, FabricMC's fork of Fernflower, and a direct continuation of Quiltflower. Compared to other Java decompilers, Vineflower often produce better result, even so close to the source code itself, see the output comparison.
To use Vineflower, you need to download the latest JAR file release from the Github release page. You will also need to retrieve the client.jar file (the game's main program) from the .minecraft directory under .minecraft/versions/<version>/<version>.jar. Typically, you would need to launch the specific game version before in order for the Minecraft Launcher to download the JAR file. The server.jar may also be used to generate the source code, however, it only contain server specific codes, excluding entity rendering, model resources, and other client features. Additionally, both JAR files are available on the wiki's version pages, see Category:Java Edition versions.
After doing the prerequisites, open the terminal and run the JAR file with the following command:
java -jar vineflower.jar 26.2.jar out
This will produce out directory containing readable Java source code files. The vineflower.jar might be different depending on the version. Additionally, you can run java -jar vineflower.jar --help to see all available options, or read the usage documentation.
Minecraft Decompiler
[edit | edit source]MinecraftDecompiler is a JAR tool made by MaxPixelStudios that can generate the game's source code from various obfuscation mappings and custom decompilers from the community, and the official Mojang mapping. Unlike a standalone decompiler (like Vineflower), this tool also processes obfuscation map to deobfuscate the game before decompiling. Since update 3.3.2 released 2 years ago, it only supports obfuscated game versions with official Mojang mapping from Java Edition 1.14.4 up to Java Edition 1.21.11.[3] However, the tool also works on Java Edition 26.1 and upper, but only if you add the flag (piece of shell command) at the end of the command: --skip-when-absent [4]. However, this requires a developer version of the tool that you can only get by building the entire project from source (by downloading its GitHub repository and running commands to build the final MinecraftDecompiler.jar file that you will then use).[4]
To use MinecraftDecompiler, you need to download the latest JAR file release from the GitHub release page. After downloading, open a terminal in the same directory as the JAR file, and run the JAR file with Java by typing the following command:
java -jar MinecraftDecompiler.jar --version 1.21.11 --side SERVER --decompile --output 1.21.11-remapped.jar --decompiled-output 1.21.11-decompiled
This will write a mapped version of the server.jar to 1.21.11-remapped.jar, as well as decompiling the game and writing the generated source files to 1.21.11-decompiled. The following arguments for the MinecraftDecompiler software are used:
--version <version>- This specifies which version of the game you want to decompile. MinecraftDecompiler will automatically fetch the game's executable files from the specified version.
--side <environment>- This specifies which environment you want to decompile. There are two environment you can specify:
CLIENTandSERVER. The client environment contains the entire game you're playing, while the server only contains the resources necessary to host a multiplayer game. The client includes the entire server code, plus client specific, like rendering, user interface, etc.
--decompile [<decompiler>]- This specifies that you want to decompile the game, usually after deobfuscating the JAR file. Optionally, you can also specify which decompiler you want to use. By default, it uses
vineflower, but you can use other decompilers:fernflower,forgeflower,cfr, oruser-defined.
--output <mapped-jar-output>- This specifies the output file for the deobfuscated JAR file (or mapped JAR file) from the obfuscation map.
--decompiled-output <decompilation-directory>- This specifies the output directory for the decompilation files.
Additionally, you can run java -jar MinecraftDecompiler.jar --help to see all available options.

McDeob
[edit | edit source]McDeob is an open-source JAR tool made by ShaneBeeStudios that can also decompile the game's code, both server (server.jar) and client (client.jar). It is able to do this entirelly autonomously since it downloads the right JAR in the selected version, extracts it, deobfuscates it (if needed) and decompiles it (if the option was checked). It also automatically ZIPs the output.
Compared to MinecraftDecompiler, it has more updates[5] and thus supports more recent Minecraft versions. It also has a GUI by default. Even though the app is originally made for MacOS, it also works on Windows and Linux if you download the JAR file from the releases instead of the DMG file.
The GUI is self-explanatory and doesn't need much explanation to use. If you have problems running it, make sure you have Java installed system-wide (not just Minecraft's default Java installation) and try running it from terminal via:
java -jar McDeob.jar
The main downside of McDeob is that it uses PaperMC's unsupported fork of FernFlower rather than the more recent and better Vineflower. If you need to use Vineflower, MinecraftDecompiler is the better option.
Using built-in IDE functions
[edit | edit source]If you prefer to download as little additional software as possible, you can also view Minecraft's source code using built-in IDE functions from IntelliJ IDEA, Eclipse, or Visual Studio Code. They let you view an artifact, which contains the game's source code, generated from a mod project (i.e., creating a Fabric mod) for development purpose; such project has a build configuration (like one with Gradle) that specifically does this.
You can start by getting the template of a Fabric example mod project from GitHub, and opening it in your IDE of choice.
Next, you will have to ensure that the version you want to find the source for is selected. If you want to use the latest stable version, i.e. 26.2, you may skip this step, as the example mod will almost always be up-to-date. Otherwise, navigate here, select your chosen version in the first dropdown menu, and update your gradle.properties file accordingly.
Once you have completed this step, open a command line window. If this window is in the IDE, run gradlew gensources, or ./gradlew gensources if you are on Linux or Mac. However, if this window is separate from your IDE, remember to run cd path/to/mod_folder/ first.
Now, return to your IDE window and follow the steps below, depending on the IDE you use:
- Visual Studio Code: ⎈ Control/⌘ Command + P, and begin typing possible class names with the
#prefix - IntelliJ IDEA: ⎈ Control + N or ⌘ Command + O, and begin typing possible class names
- Eclipse: ⎈ Control/⌘ Command + ⇧ Shift + T, and begin typing possible class names
Legacy Yarn (pre-1.14.4)
[edit | edit source]Mojang Studios have only released official mapping from Java Edition 1.14.4 onward, any versions older require a community mapping in order to be deobfuscated. This tutorial will use Legacy Yarn by Legacy Fabric, which is a community mapping for versions from Java Edition 1.13.2 down to Java Edition 1.3 with several snapshots. It's used to remap the JAR files through Tiny Remapper with the intermediary mapping, and the resulting remapped JAR file is then decompiled with Vineflower to produce readable source code.
Prerequisites
[edit | edit source]To use Legacy Yarn and decompile the game, you'll need the following resources:
- the game's JAR file to be decompiled, typically client.jar or server.jar;
- the Legacy Yarn mapping;
- the JAR remapper tool, which is Tiny Remapper; and
- the decompiler, which is Vineflower.
Obtaining
[edit | edit source]Legacy Yarn provides many obfuscation maps for various legacy versions of the game, which are listed on the Legacy Fabric's Maven repository. Each directory is named like <version>+build.<build>, where version is the game's version, and the build is a unique build ID for the mapping. Open the directory with the target version, and the highest build number for the newest mapping provided.
In the directory, you'll need to find a file that ends with -mergedv2.jar (e.g., for 1.8.9 build 604, it's yarn-1.8.9+build.604-mergedv2.jar). This JAR archive file can be opened with any archival software/tool (such as 7-Zip), and contains the mapping file required for Tiny Remapper. It's stored inside them as mappings/mappings.tiny. As such, you'll need to extract them in the current directory, preferably next to Vineflower and Tiny Remapper software. We'll reference this mapping as mergedv2.tiny later on.
In order to get Tiny Remapper, you'll need to find a JAR file from FabricMC's Maven repository. The listing contains multiple versions for Tiny Remapper, you'll need the one with the latest release. Upon opening the directory, download the fat version (e.g., tiny-remapper-<x.y.z>-fat.jar).
The client.jar or server.jar, which contains the program and resources for the game, can be found on .minecraft/versions. This is the game's JAR file that gets to be remapped and decompiled later with Tiny Remapper and Vineflower. Older versions of the JAR file can typically be found on the wiki's version pages.
Remapping
[edit | edit source]Legacy Yarn uses three namespaces for mapping:
- official – the obfuscated names in the original game JAR file.
- intermediary – a stable intermediate names from Legacy Fabric.
- named – the readable Legacy Yarn names.
These namespaces are used to differentiate which names of the mapping come from, especially for intermediary and named. Before the official names get remapped into the named, it has to go to intermediary names first. This is because the named mapping are mapped from the intermediary names, which are preferably because they considered stable (unlikely to change) compared to the official (obfuscated) names, and can be referenced across multiple Minecraft versions.[6]
Luckily for our case, the mergedv2.tiny mapping already contain both intermediary and named mapping combined, so we don't need to manually remap to intermediary first. Otherwise, there is the non-merged version which requires to do so with the two mappings.
After setting up the tiny map file and tools, run the following command in the current directory:
java -jar tiny-remapper-x.y.z-fat.jar client.jar client-named.jar mergedv2.tiny official named
Once the remapping step is complete, decompile client-named.jar or server-named.jar with Vineflower in the usual way.
References
[edit | edit source]- ↑ https://github.com/fabricmc/yarn
- ↑ "Removing obfuscation in Java Edition" – Minecraft.net.
- ↑ https://github.com/MaxPixelStudios/MinecraftDecompiler/issues/211
- ↑ a b https://github.com/MaxPixelStudios/MinecraftDecompiler/issues/211#issuecomment-3691679083
- ↑ As of 2026/08/26, MinecraftDecompiler has last been updated 2 years ago versus 5 months ago for McDeob.
- ↑ https://wiki.fabricmc.net/tutorial:mappings#intermediary