- 420
- IGN
- videogamesm12
Mojang officially announced that starting with snapshots for the update that comes after 1.21.11, compiled binaries for Minecraft: Java Edition will no longer be obfuscated. This means that anyone will be able to crack open the game and look at its code for use in modding projects and other technical deep dives. This welcome change seems to be a part of a broader effort by Mojang's development team to make the game easier than ever to create mods for and simplify the development process for many mods.
https://www.minecraft.net/en-us/article/removing-obfuscation-in-java-edition
To make it easier for mod developers to understand the inner workings of the game, mod loaders like Forge and Fabric use systems which would attempt to descramble this obfuscated mess using lists of references called mappings. These lists attempt to create a version of the game that mod developers can understand the codebase of and thus be able to use as a foundation for their mod's codebase. It's like taking a baked cake and then reverse engineering the cake to figure out the ingredients to rebuild the recipe. While mappings for these versions have been unofficially maintained by the modding community for more than a decade, in late 2019 Mojang began to release official mappings of their own under a somewhat restrictive license binding all mods written using it to the game's End User License Agreement, which was a good first step but meant there was always a middleman in place.
Mappings are not a perfect recreation of the game's source code, but rather a reference point used by mod developers and mods to find out where to hook their code into. It's also worth noting that there are actually two sets of mappings depending on the environment the game is running in:
Here's just a few examples of how this will affect you in one way or another:
https://www.minecraft.net/en-us/article/removing-obfuscation-in-java-edition
Technical Explanation
Presently, versions of the game released to the public typically have their internal names of functions and variables scrambled using a method called obfuscation to make it more difficult to reverse engineer the game or make clones of the game. When you attempt to open an unmodified copy of the game in a decompiler tool like JD-GUI, instead of getting a nice tree showing the inner structure of the game, you are instead greeted by a massive list of classes with seemingly random alphanumeric names with equally confusing field names. While this is great for protecting the game against possible copyright infringement, it makes modding the game like this excruciatingly difficult without specialized development tools and some serious know-how.To make it easier for mod developers to understand the inner workings of the game, mod loaders like Forge and Fabric use systems which would attempt to descramble this obfuscated mess using lists of references called mappings. These lists attempt to create a version of the game that mod developers can understand the codebase of and thus be able to use as a foundation for their mod's codebase. It's like taking a baked cake and then reverse engineering the cake to figure out the ingredients to rebuild the recipe. While mappings for these versions have been unofficially maintained by the modding community for more than a decade, in late 2019 Mojang began to release official mappings of their own under a somewhat restrictive license binding all mods written using it to the game's End User License Agreement, which was a good first step but meant there was always a middleman in place.
Mappings are not a perfect recreation of the game's source code, but rather a reference point used by mod developers and mods to find out where to hook their code into. It's also worth noting that there are actually two sets of mappings depending on the environment the game is running in:
- Intermediary mappings are a set of mappings that give the scrambled code more functional names that can tracked more easily. These are used during runtime in regular modded environments, and compiled binaries of mods use these when calling internal Minecraft code. For example, in 1.21.10 the obfuscated name for the class representing all text components is just
xx, which gets remapped tonet.minecraft.class_2561in Fabric andnet.minecraft.src.C_4996_in Forge. If you ever opened a crash report generated by a modded version of the game, this is what you'll see in the stacktrace.
- Human-readable mappings are an extra set of mappings for use in development environments. These translate the still cryptic intermediary names into something more readable by a mod developer. These are used as reference by mod developers and mod source code to find out where something is in the game's code. For example, the class representing all text components mentioned before gets remapped to
net.minecraft.text.Text,net.minecraft.network.chat.Component, or something similar depending on the mappings used. During the compilation process, the development tools seek out and translate these human-readable mappings in the source code back into intermediary mappings in the compiled binary using a process called "remapping". One key difference between Mojang's mappings and community-sourced mappings like Yarn, MCP, or Searge is how they are applied to the game's code in the development environment - Mojang's mappings bypass the intermediary layer entirely and map the obfuscated names directly to the more human readable names whereas the community mappings are layered on top of the intermediary mappings.
This is huge
I can't even begin to describe the impact this will have on the game and its legacy. Mojang has historically always had a favorable view on mods and has maintained very good relations with the wider modding community. Many components of the game (such as how the game handles blocks, items, sounds, mobs, etc) are designed with modders in mind and it's clear this is part of a broader move to make the game more accessible to mod developers than ever.Here's just a few examples of how this will affect you in one way or another:
- Identifying and debugging issues will become a lot easier with human-readable code in the stacktraces. For years I have been debugging and analysing exploits using a Fabric mod development environment as the foundation, which is a resource intensive task to set up due to how much system resources remapping game binaries takes up. This will simplify the process greatly.
- Since this will make it easier to create mods for the game, there will likely be even more mods in the Minecraft ecosystem in the future. This greatly benefits players who like a more modded experience.
- Since mappings are just some of the things that makes mod loaders different, mod developers will not have to worry about differences in mappings moving forward. This means that Fabric mod developers will not have to essentially relearn the game's codebase from scratch when they want to start working on Forge mods or Paper plugins.

