Minecraft Modding Tutorial Installation and Base Class To be able to actually start with modding in 1.18, we have to install the whole thing first. Therefore, we will first install Fabric and then create some of the base classes and so on. So, basically all the stuff you need to get started with modding properly. Installation The installation of Fabric is actually quite easy, because you have to go here first to the Fabric Example Mod; which is of course linked in the description. It’s just this page…here on Github, where you can easily find it. We just go to “Code” and download it. We’ll just save it somewhere. Then you have the Fabric Example Mod in your download folder. And then we simply extract it somewhere, let’s just say the download folder itself, and then go in there; where we then have all these files here. Then we just open a folder somewhere – it doesn’t matter where, just where do it wherever you want to install your modding environment. Then just…make a new folder here. In this case we call it “Tutorial”. And then we just put everything in there from the Example Mod. And what we then have to do is, we have to go into this “gradle.properties” file (in this case shown as “grade”). You just have to look for the file with: Type = PROPERTIES file You open it with any text editor; is irrelevant which one. And then here we just say… This isn’t “com.example”, but in this case we call it “com.brickmotion.tutorial”. You can call it whatever you want. And then we don’t call it “fabric-example-mod” here, but simply call it “tutorial-mod”. Wich is our “archives_base_name” in this case. And that’s basically what you have to do in there. What you have to do then depends on the program you want to work with. If you’re working with IntelliJ, it’s all done a little differently from what I’m going to show you here; I still have Eclipse installed, but I’ll put the link where the whole thing is explained for IntelliJ in the description. You can read about it there. For Eclipse you have to go to the PowerShell then type: .gradlew eclipse (Das “.” – das habe ich ja schon einmal erklärt – in der PowerShell muss das irgendwie da sein) And then it starts, but it fails pretty quickly because he suddenly says: “Wait a minute, Java 8, that doesn’t work anymore. You have to have a newer version.” Because Mojang actually went: “Well, Java 8, that’s like 10 years old or something; we should maybe switch to a newer Java.” And accordingly…if you haven’t programmed in 1.17 already, where you can also work with Java 16, Then this will no longer work; then you have to change this first. Accordingly, we simply go to the Java download page here, and as you can already see: Java SE 17 actually already exists. Of course, we’d better take that one. They said Java 16 or higher, that’s up to you, but Java 17 is the most up to date technology. Then you just have to choose one of these things. In my case I would say Windows x64 Installer. As for the other things here…Linux, MacOS, Windows MSI Installer, whatever…it just depends on what kind of operating system you have. But in my case it’s the Windows x64 installer. Of course, it tells me: “Wait a minute, it’s already installed here on your system, you shouldn’t do it again.” For you, of course, this wouldn’t be the case if you didn’t already have it installed; so you’d still have to install it. And what you do then is, you go to your environment variables. As Windows has to know that you are no longer on the old Java version. You can already see that in the JAVA_HOME variable – I explained that back then in the old tutorial – we’ll just edit it here. We then simply go to (probably) C:/Program Files/Java and then have to look for the correct version. In this case, it is jdk-17.0.1. This was the old one we used. I installed this one for 1.17. I think the JRE doesn’t exist anymore (or at least I can’t find it on the Java page). I think it’s all just JDK by now. The we go to “Properties” of the “bin” folder, copy this path and replace it in the “JAVA_HOME” variable. And it was in here in the “PATH” variable. There we have this entry down here, and we just replace everything in front of the “bin”. And thus changed our environment variable. Then we go back to our folder and try the whole thing again. And you might see: it doesn’t crash again immediately; Because we now have the correct Java version in there, of course. As said before, if you use IntelliJ, then instead of doing all of this stuff I’m showing for Eclipse (that you enter this “./gradlew eclipse”)… …you can follow this description on screen. That’s all made a bit more convenient so that you can really do it easily in IntelliJ. So that’s that. Just read through all this yourself or look for it on YouTube, I’m sure you’ll find some tutorials on how to do it. If I find one myself, then of course I can link it somewhere around here. But as far as Eclipse goes, this is how to do it. As you can see, we were successful this time. Then we have to create a new folder for Eclipse outside (!) of the folder where we installed it. Which we will just call…”Eclipse environments”. Just has to be some folder that is not inside the folder where you installed all the stuff in. There, we create a folder called “Tutorial”. Then we start Eclipse and open the folder we just created. Right…open this one, and “Launch”. And as you can see…well…there isn’t so much going on here right now, as the whole thing has to be imported first. We choose a “General”…where we import an existing project. We browse for it… Not in the Eclipse environment, but in the “Tutorial” folder. Then we finish…and now you’ve got your “Tutorial” folder in here…where it has a problem somewhere…two errors, to be exact… That’s probably because we haven’t told Eclipse… …well it doesn’t yet know about the new Java version. That’s why we go to “Preferences” → “Java” → “Installed JREs”, and then we add a “Standard VM”. Then go to our “Programs” → “Java”…and…”jdk-17.0.1” it is. You just have to select the folder. Finish. And then use this one. We still have to select it, so we go to “Properties”, and then we go to “Java Build Path”. Then go to “Libraries” and remove that one, add a library…just choose this…and finish. And then the error is gone. All of this is only nessessary if you have not worked with this Java version before, of course. Base class & Co. What do we do now? Now we say “net.fabricmc.example”…we’ll first make a new package and call it “com.brickmotion.tutorial”. And add a new class. And we just call this one “Tutorial”…yeah, that’s what we call it. Also, this “mixin” thing, we can simply delete, we don’t need that at all. Here we now say “implements ModInitializer”. We import that one (the one from “net.fabricmc.api”). Then we add the unimplemented methods, and then we are already finished with the base class for the mod; wich we will use for just about anything. You can now delete the Example Mod, we don’t need it anymore. One more thing: You have to go to “src/main/resources”, because there you’ll find this “fabric.mod.json” file. Wich you’ll have to adjust before modding. First of all…the name isn’t “Example Mod”, it’s simply “Tutorial”. You can call it whatever you want, of course. Description…well… “Great mod or whatever” Just write something in there, whatever comes to mind. The icon, here you can simply add an icon picture. This should be in “assets”…there we have it; “assets.modid”, that’s where the icon is. Which in the case…it looks very nice, I must say, the developer really put in the effort with this graphic. You just create some of graphic that you put in there; You should just call it exactly this (you can also name it differently, then you just have to change the path here). And of course the entry point, this is also important. Because that’s not “net.fabricmc.example.ExampleMod”, but “com.brickmotion.tutorial.Tutorial”. Just enter the exact name you used for your file. We don’t have any mixins at this point, we will get to that at some point in a later tutorial, when I’ll explain mixins to you. “suggests”, I think you can put in any mods that your mod depends on, we will come back to that at some later point as well. The dependencies, there you have the “fabricloader”, that’s just the version of Fabric. We have “fabric” here again…”minecraft” is 1.18 in this case, Java is >= 17, because that’s the version that we have installed. And the “entrypoints”, we can actually do a little preparatory work for future tutorials, Because there’s not only “main”, but we also have others, namely there is a file for “client”, where specific client-heavy things would be done, for example some graphic rendering. Basically what you don’t need on a server. We just call this one “com.brickmotion.tutorial.TutorialClient”. That file doesn’t exist yet, of course, so we will just create it. So we add “TutorialClient”. And it implements “ClientModInitializer”. Let’s also add its unimplemented methods really quickly. And while we’re at it , we’re also creating a “TutorialServer” file. Admittingly, I don’t know what exactly you would need this one for as of right now, but for the sake of completeness I’ll add it anyways. By the way, you don’t have to add both of these files. It just depends on what your mod is supposed to do. I will go into this in later tutorials, of course. We’re just doing this now as preparatory work for tutorials where we might need them. As I said, you don’t necessarily have to create these files for now, you can just leave it at “main”. Anyway, the “TutorialServer” implements a “DedicatedModInitializer”. Wich we can now import, as well as tell him to add the unimplemented methods. we just quickly copy this and change it to “server”. And this one to “TutorialServer”. Also, ther’s another one called “preLaunch”. That one does some stuff before the actual game is loaded, but I don’t know in what context this method would ever be needed. It’s also written on the Fabric website that this really isn’t meant for general use. So this is really only intended for very advanced stuff. I’ll just ignore it for now because I really don’t know in what context it would ever be needed. If there ever is a tutorial where we need, then we’ll just add it then. But for now, we’ll just stick to these two, as these are the ones you will most likely need (client and server). As said before, you don’t have to add them for now, you don’t need them at the beginning, but maybe later in more advanced tutorials, they might come into play. What’s also important, you must not forget to change this ID to your Mod-ID rather than leaving it as “modid”. So in that case, “tutorial”. Accordingly, we say “tutorial” as the storage location for the icon and we change the path here accordingly. Here, “Refactor” → “Rename”, this isn’t “assets.modid”, but “assets.tutorial”. Then you can simply delete this “modid.mixins.json”, we don’t currently need that because we don’t currently have any mixins. So it can simply go away. And what we might as well do, so that we don’t forget it later, we also add in here: public static final String MOD_ID = “tutorial”; So now, we have our mod ID in here as a variable. That might come in handy, but you can also leave it out. You could also just write down the ID whenever I say “MOD_ID”. But this way, you have it centralized, wich might be better. Well, I think that’s just about it. What we then of course have to do is starting the game. For that, we have to go to our “Run Configurations” and then we simply go to “Tutorial_client”, wich we will now run. You can see “Minecraft 1.18 / Fabric (Modded)”. There’s apparently no “Mods” button in the Fabric version. That’s unfortunate, as we don’t see whether or not it worked, but I’ll just assume that it did. We’ll just create a world…we’ll allow cheats, we select “Creative”. “More World Options…”…I guess this fits our needs. And then we see a beautiful 1.18 world here, with some extreme cliffs we have spawned on. Looks kind of weird, like it wasn’t intended to be this way, but apparently it is, I mean, we’re not on an old world or something, you saw that I just created it. Oh well, I guess we will start to actually add stuff in the next tutorials. So…yeah…that’s it for this tutorial, bye. Video Information
This video, titled ‘Fabric-Setup & Erstellung der Basisklasse | Minecraft Modding Tutorial [1.18 | Fabric | DE/GER]’, was uploaded by Brickmotion on 2021-12-06 14:00:20. It has garnered 483 views and 8 likes. The duration of the video is 00:17:11 or 1031 seconds.
In the Minecraft modding tutorial series I explain to you how you can program mods for Minecraft 1.18. I try to bring the topic closer to programming newcomers. In this video I explain to you how to install Minecraft Fabric and the rest of the modding environment and get it ready for use, as well as how to create the base class, which serves as the basis for all further tutorials. TIME CODES: 0:00 – Introduction 0:20 – Fabric Setup 8:00 – Base Class Creation Links: Fabric Example Mod – https://github.com/FabricMC/fabric-example-mod/ JDK Download – https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html IntelliJ Setup: https://fabricmc.net/wiki/tutorial:setup