For once I'm glad that Minecraft is written in Java because it makes modding it have such a low barrier of entry compared to games written in compiled languages.
Bytecode and machine code are not interchangeable. They mean different things. You wouldn't call a Rust binary "x86/ARM bytecode," would you? Would you say Python gets compiled to machine code because it gets parsed into CPython bytecode? No, you wouldn't. Calling something like Java bytecode or a WASM binary "machine code" only serves to confuse things so you can feel smart.
And most implementations of the JVM generally don't transpile Java bytecode to machine code; the only exception I'm aware of is GraalVM. So Java bytecode (usually) never becomes machine code.
Semantics about bytecode aside, specifically Java bytecode is pretty high level, which makes it easier for modding. This is not the case with e.g. Webassembly, which is also bytecode, but much lower level and would give you a harder time modding it
Which is interpreted by the JVM, until profiling data show that that piece of code is run slowing down the application, and then it gets compiled (twice) to actual instructions
I think the point yall are missing is that the code is shipped only obfuscated (until recently) instead of compiled which is what has enabled Javas massive mod community. Yes Java uses JIT compilation but that’s irrelevant to the original point being made
It’s compiled to generic byte code that machine cannot understand
then it is interpreted (converted to real machine code that is different per machine) by JVM (Java virtual machine)
then small snipers of code that are frequently repeated such as loops can be compiled as actual machine code and stored in ram for even faster usage until they are not used anymore.
That's alright. Even if C# exists, Java is still a nice option for modding. Wasn't trying to make a comparison between Java and other languages that compile to some sort of bytecode.
Yes and no. While java made it a bit easier, it caused all sorts of other problems with the modding community.
Compare Minecraft to games which actually have good mod support:
Vintage Story, Rimworld, Starbound, Factorio (Edit: guess people have issues with this one in perticular)
The trick is to not have to have your mod creators program at all by default. Use a data format that is easily able to be learned and have a patch system so that multiple mods don't clash.
I haven't played these other games, but I don't think Factorio is a good comparison.
The domain of what is possible in modded Factorio vs modded Minecraft is extremely different, majority of Factorio mods just extend on what the game already does: here are machines, they convert things to other things. Majority of mods fall into this bucket, including many overhauls. Even when mods do something unusual, it's usually very hacky and sometimes half broken. Looking at you Space Exploration spaceships, nav view, space elevators. For another non-gameplay example graphtorio comes to mind (there are actually several different ways to implement graphtorio-like functionality within limits of what you can do with Factorio API, but all of them are kind of terrible).
A lot (majority?) of mods in Minecraft go so beyond what the game fundamentally does. From game optimizations, shaders, to more big stuff. Thinking IC, BC, AE, or for a more modern example Sable/Create: Simulated (or Create: Aeronautics which uses it).
It does very much depend on what you are doing, yes. But that kinda goes a bit against what I'm explaining here. Though I will admit Factorio is a bit of an odd one out in the group, but it is still designed for modding from the beginning.
The a lot of people going "away from the core game" depends more on the number of people playing the game and has less to do with how difficult the game is to mod. The majority of minecraft mods don't actually go against the grain, they add simple things that can easily be done with only a few minor details, however due to it's massive fan base there are a lot of "large scale" mods that go far beyond what minecraft does normally. There is also a bit of survivorship bias as most mods that make it into modpacks tend to be the larger well made mods that change up the game because the default of minecraft is rather boring (hence everyone's 2 week binge).
But the majority of mods are primarally "this block drops something when mined", "put this in crafting grid to make thing" and "magic blocks" (you put item in, get new item out). It wasn't until Create came along that really threw a wrench into that idea and in the grad scheme of minecraft's entire life it's honestly pretty new.
And even then these mods need a core (forge, fabric, etc.) which are all made by a large team to make it even plausible to do such things.
A prime example of people will force things to do things they aren't designed to do if there is enough of an audience is Skyrim, which is an absolute pain in the arse to mod, it's not mod friendly at all and you are constantly fighting it every step of the way and is a buggy mess, and yet there are lots of large scale mods for the game that go far beyond what the game was designed for.
Just because something has larger scale mods that go against what it was designed for, on it's own doesn't mean much.
My point primarily was that for games with modding support you are bound by what is possible within the modding API, thus the domain of possibilities is lower.
It is much less so for cases like Minecraft. But the tradeoff here is that modding at all is a mess compared to a game provided API.
Fun fact, the Factorio Space Age expansion is technically a total overhaul mod. (They did it that way to avoid having to support multiple versions/branches of the gane.)
There are also community made total overhaul mods that change the content of the entire game.
Factorio has one of the worst mod support ever; conflicts are pretty common, most mods are basically recipe changes that require reskinned crafters or vehicles, anything that deviates from that is a janky hack held together by duck tape. And it still doesn't have a decent mod loader that can handle profiles and modpacks are still just fake mods with dependencies. Over 60 doubloons btw.
Well Minecraft already provides official ways to add data and scripts in the form of datapacks with mcfunction scripts. I'm speaking purely in terms of how easy it is to modify and add onto the game's code itself, which is purely a community led effort that doesn't concern Mojang at all, and I find that much more interesting than having to go through a curated API. The fact that Minecraft is written in Java means that you can patch class files as they are loaded by the JVM to modify code with Mixins to call your own code which then uses Minecraft's own code as an API. I don't know how feasible that is with game's written in languages like C++ or Rust.
I'm guessing you haven't tried to mod the games I have listed.
I made a few Minecraft mods back in the day. And yes minecraft did add datapacks later in it's life and that does work similarly, but not to the same scale. As minecraft was not made with datapacks in mind, it's everything exists in code and we've just curated a list of things you can access.
I've also made mods for all the above games. We aren't talking "Curated APIs" but rather the structure of the base game is designed like this. So rather than "hey we've enabled the players to access this part of code years after the system existed" it's a "we needed this feature so now you can use XML or JSON to interact with it"
Then if you need actual complex work you can then implement that in code, usually making your own API to enable more features, which often makes it so even more mod makers don't need to know how to code. But most of these games are also easy to modify the code of as well, and the way it's structured it often is very simple due to how modular the underlining systems are made.
That's not an issue of Java though. That's more due to how Mojang approached Minecraft's data architecture. They've gotten way better at it in the last ~7 years.
It's useful because Java is multi-platform, and resulted in it being easier for the community to make their own modding APIs. Though if they were to do it again, then they should make the official modding API they promised over a decade ago, and support WASM mods. That makes the mods sandboxed, significantly reducing the risk for malicious mods, and it lets people use whatever language they prefer.
View all comments
565
u/ArkoSammy12 Oct 07 '26 edited Oct 07 '26
For once I'm glad that Minecraft is written in Java because it makes modding it have such a low barrier of entry compared to games written in compiled languages.