Minecraft: Java Edition will no longer be obfuscated in future versions

videogamesm12

Developer
Developer
Senior Admin
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

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.


1761845732609.png
This must be what reading ancient hieroglyphics must be like

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 to net.minecraft.class_2561 in Fabric and net.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.
With everything I just wrote about deobfuscating, mapping, and remapping and all that, Mojang's decision completely chucks all of this out the window and would instead allow anyone to crack open the compiled game JAR in a standard decompiler and read the game's code from there. Creating mods for the game becomes far simpler because it removes the need to remap the game's code entirely. This effectively eliminates the middleman which has been part of the mod development process since the very beginning.

1761846665811.png
A hypothetical breath of fresh air.

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.

TL;DR​

Mojang is making the Java Edition easier to understand from a technical perspective by completely removing one of the bigger roadblocks holding the modding community back. This will greatly benefit several huge sectors of the modding community. Cheers, Mojang!
 
  • Like
Reactions: Telesphoreo
Now if only they'll give us the Javadocs for said code so we have documentation on what does what. 😵‍💫
 
This is interesting. I almost wonder if Mojang would actually accept contributions to the base game from non-Mojang developers. Perhaps they realized they can't replace their devs with AI, so Microsoft is effectively open sourcing it to eventually fire the devs anyway. It seems to be a bigger play especially given how things are going with Xbkx right now.
 
This is interesting. I almost wonder if Mojang would actually accept contributions to the base game from non-Mojang developers. Perhaps they realized they can't replace their devs with AI, so Microsoft is effectively open sourcing it to eventually fire the devs anyway. It seems to be a bigger play especially given how things are going with Xbkx right now.
I honestly never even considered that as a possibility, but given Mojang's track record of importing ideas from existing mods, I honestly don't know. Microsoft opening up their biggest moneymaker (Minecraft is currently the #1 best selling game of all time) to community contributions seems way too much of a fever dream to actually happen, but yet we have seen them import ideas from mods like MoCreatures and sometimes even collaborate with mod developers to get features into the game.

I've heard similar theories that this is part of a larger play to eventually wind down support for the Java Edition and focus more on the Bedrock Edition. After all, having to maintain two separate teams to maintain two very separate versions of the game probably wouldn't sound very efficient in the eyes of Microsoft. However, Microsoft canning the Java Edition would probably hurt them more than anything as it would leave people running Mac OS and Linux up shit creek, since as far as I know the Bedrock Edition currently supports neither of those operating systems.
 
minecraft is officialy FOSS 🤔
me when i don't know what words mean...


However, Microsoft canning the Java Edition would probably hurt them more than anything as it would leave people running Mac OS and Linux up shit creek, since as far as I know the Bedrock Edition currently supports neither of those operating systems.
microsoft can barely keep azure up if they can every non windows platform from playing the latest versions they are essentially shooting themselves in the foot

also we'll probably have to rely on Hypixel or some other big entity to do authentication (please not CurseForge i do not want benjamin netanyahu to own my account)