Hey guys it’s thomas here with technovision and in this tutorial series i’m going to show you how to create a minecraft mod for version 1.19 using the fabric api now the first thing we want to do to get started is of course download the java jdk and you can do That by going to the description of this video and clicking on the first link which will take you to the java download page now you’re welcome to use adopt open jdk or the oracle version whichever one you prefer but you want to make sure that you download at least java 17 or Above so you can use 18 if you would like but i’m gonna use 17 for this series so scroll down here click java 17 and select your operating system in my case it is windows and i’m going to download the x64 installer here so hit download and i’ve Actually already downloaded it and it’s on my desktop so once you have downloaded it you’re gonna get this little install here and you can double click it to open it now once you’ve opened up the installer it’s really quick all you have to do is hit next and then next again And it should take less than three seconds to install as you’ll see here right now and there we go so java has successfully installed you can hit close and we can actually throw away this installer as we no longer need it now the next thing we need is an ide software and you’re Welcome to use whatever ide you want but i’m going to be using the intellij ide so we’re going to download that right now so go to the description to that second link and that will take you to the intellij download page and of course you can download the community edition For free as always so we’re gonna hit download and uh like always if i already downloaded it and it’s on my desktop so once you have the actual application you can double click to open it now once it’s open you can just hit next and then next again And there’s a few options here i’m going to select but you can select whatever you would like i want to add a desktop shortcut since i think that will be handy and i like to have the bin folder added to path so we can do those two There and the rest i’m going to leave blank but again you can select whatever options you would like here hit next and then install and it’s going to take a second to install so i will see you when it’s done All right so as you can see the setup has completed and it’s going to actually ask you to restart your computer to finish the installation so what we’re going to do is click reboot now and when you select finish this is actually going to restart your computer immediately so Just be aware of that and now we’re going to restart our computer so i’ll be right back when that’s done all right so my computer has restarted and now we can actually delete this installer because we no longer need it and we do have this little desktop icon So we can run our ide so great everything’s working perfectly there uh now the next thing i’m going to show you is two optional pieces of software that i highly recommend downloading but again they’re optional but i just think they will be very helpful for you guys so in The description the next link will take you to a notepad plus plus download page this is a really useful software that will allow you to edit files from your desktop easily so i highly recommend downloading this and the next thing is also winrar this is a application that allows you to Open archives or dot rar uh files essentially so i highly recommend downloading this as well or 7-zip both work great but i’m not going to show you how to download these because it’s very simple but yeah i highly recommend those two applications all right so now we can actually get Started making our mod so what you want to do is go to that next link in the description and it will take you to this github page called the fabric example mod this is a example template mod that fabric puts out and updates every time minecraft or the fabric api is updated And this will give you a just really easy starter template so we can get right into it so you can use this as a template if you want to make a github repository but in my case i’m just going to show you how to download it and do it from there so We’re going to download this as a zip by going to code and download zip and i already have it on my desktop but it will give you this archive here fabric example mod for 1.19 and uh this is where winrar comes in handy we can double click this to open It and you’ll get this little folder here and you can see that we have all these files inside of it this is the actual mod itself that we’re gonna we’re gonna edit so we can drag this file to our desktop and there we go it’s gonna make a copy of it And uh we can actually get rid of this archive because we no longer need it and yeah we are actually gonna rename this folder now to the name of our mod so i like to use camelcase but you can name it whatever you would like of course i’m going to name mine tutorial Mod like that in camelcase and i’m just going to throw it over here to the right hand side so that we can store it really easily on our computer great uh the next thing you want to do is open up this tutorial mod folder here And you’re going to want to go to the uh gradle properties source file so it’s just going to be called gradle and it’s going to be a property source file type here and we can right click here and edit with notepad plus plus or you can use whatever notepad application that you like And oh this is full screen but it’s going to open up a little notepad here and this is pretty much just some basic fabric properties that we can edit uh so first thing we want to edit here is the uh the memory usage so this is how much Memory is available to gradle to build our mod if you have a lot of memory you can set this to something like three or maybe even four gigabytes of ram but in my case i’m just gonna set it to i guess two um you can do whatever you want here you Can leave it as one if you would like it’s just gonna allow your mod to run uh faster or build faster rather in gradle uh next thing is the fabric properties this is the minecraft version and the uh yarn mappings version and loader version that we’re going to be Using for this mod so we have 1.19 here of course because we’re doing this for minecraft 1.19 and it comes out with some you know a preset version here for our yarn mappings however uh sometimes this is not always up to date so what i want you guys to do Is go to the next link in the description and that will take you to this great website here on the fabric websites you can also actually see i believe a link to it right here so you can also just click this link as well both will take you to The same page but this is going to allow you to actually check the most up-to-date uh version for this mappings loader and also the fabric api so we can select our minecraft version here and you could do any version you want so in our case we’re doing 1.19 so we’re going To click 1.19 and you can actually see here if we bring this up that uh there are actually some things that are a little bit out of date so yarn mappings is out of date and so is loader version and also so is fabric version so we can Update those really quickly by just copying so we can copy yarn mappings and paste it in here and push it forward a little bit uh so this was updated to build.4 and then maybe just to make this easier i’m just going to copy the version so loader version i’m gonna update And fabric version here as well there’s another thing we can update uh so yeah you don’t have to do this the the template itself is fine but i like to have the most up-to-date stuff so we’re gonna do that there great so now that that’s all up to date The next thing is our mod properties and this is custom to your mod specifically so the mod version is just of course the version of your mod we’re going to leave this as is because this is the first version it’s 1.0 then we have the maven group and this is Going to be pretty much your package presentation up to the main class so uh you know there’s lots of ways to do this you can use uh github if you want to use that as your repository name mine is going to be com dots the name of me as a developer so technovision Or you could use like your domain name as well and then dots and then the name of your mod so in our case tutorial yeah so that’s your maven group and then for the archives base name it’s just going to be the name of your mod Separated with each space by a dash so in my case tutorial dash mod and there we go we can save and close out of this as we are done with it all right so now it’s time to actually open up our mod in intellij so you can go Over to intellij here and open this up and it will take a second here and we can go over to open and you want to find your mod folder pretty much so go over to users your username for your computer desktop and i believe we named it Tutorial mod so there we go tutorial mod that’s this folder right here that we just made and open that up and you want to go to build.gradle and you can hit ok and open as a project now this is going to build the project with gradle and this can take a while it Can take anywhere from a couple minutes to sometimes even up to like 30 minutes for some people uh based on i guess your memory usage what we said in that file earlier so i’m gonna let this run and i will be back when it’s done All right so as you can see here we have this green check and it says build successful so we know that everything worked great so what we can do is just close out of this and go actually to our project so as you can see here in the Pack package explorer we have our source folder here with the main folder and we’ve got java and resources now we’re going to talk about these in more detail later but resources is going to hold all of your settings for the mod and also your assets as well and the java folder Is going to hold your java code like you would expect so we have some placeholder stuff here but what we want to do is actually just delete all of this because we’re going to set our own package and our own class here in a sec so let’s actually just highlight all of this And i’m holding shift here to highlight all of it but you can just delete each one individually if you want and we’re going to right click delete and deletes so we want our package presentation to follow the same thing that we we set in that file earlier so we want to right Click new package and again if you remember i used com dots my domain name or my developer name so technovision dots and then the name of my mod so tutorial but again you can use whatever package presentation you would like there we go so hit enter and we’ve Created these packages here and if they’re all bunched up for you in like one line all you have to do to spread them out like this is go over to this little wheel up here in the top right go to tree appearance and you can uncheck compact middle packages and that will Make yours look like mine uh so that’s a that’s a fix right there if you want but in your tutorial package here the class package we’re going to right click new and create a new java class and this is going to be our main mod class so i’m Going to name this tutorial mod great so we can hit enter and what you want to do is have make sure this extends a class so extends or i guess actually i believe it’s implement so implements and this class from the fabric api is going to be called mod initializer and This is an interface here that we’re going to implement so yeah you’re going to do that and then you want to hover over this error here and make sure you implement methods and we’re going to implement the on initialize method and like you would expect this specific method is going to run when Your mod is initialized so if you want you can actually throw in like a system.out print statement so you can actually check if your mod is running but it’s not necessary so yeah now that this is done we can actually go over to our resources folder here we need to edit the Fabric.mod.json file here so go to resources open that up click here the fabric.mod.json and like i said earlier this is the settings for your mod so there’s a lot of stuff we have to go over here so the first thing is your mod id now the mod Id is extremely important when it comes to modding this is like a tag for your actual mod it has to be unique to that mod and it’s usually pretty short something quick to represent your mod so for example if your mod was named industrial craft you could put ic for Your mod id or if your mod was uh the witchery mod you could put witchery in my case i’m just gonna name my mod id tutorial but yeah very important that this is something unique to your mod and that it’s relatively short but long enough to Still be unique so yeah once you have set that we can move on to the name here and this is just the name of your mod so you can use spaces here because this is all just for aesthetic purposes to show the user uh information about the mod so In our case we could do like tutorial mod uh like that and then of course we could also set a description here so i’m gonna set a description that just says uh this uh is an example mod for my youtube series there we go and you can also set an author as well Or several authors if you would like so i’m gonna you know get rid of this me here and type in technovision since i’m the author of this mod and of course you could always add a comma and throw in another author there as well if you would like You can also have some contact information here if you have a home page or if you have a github repository for your mod if it’s open source you can throw those down here but i don’t have either of those right now so we can actually just leave these blank for right now Like that and then you can also set a license for your mod now there are several different types of licenses that you can use and i actually have a resource in the description of this video that you can click on right here on the github docs that will Actually show you a bunch of different licenses here and their little keyword and you can select whichever one you like i highly recommend doing some research on which one you want to use because they are all very different but in my case i’m going to be using the Creative commons 0 version 1.0 universal which i believe allows anyone to have access to this mod and change it if they want so i’m going to use that and we can copy this license keyword here and throw it in but as you can see it’s already in there So yeah that’s just a quick way to get to get familiar with licenses we also have the icon for our mod so this is going to be stored in the assets folder here you can see in our resources folder we do have that assets folder And uh you know the same sort of package here assets mod id icon same thing here assets mod id icon this is the icon of your mod so if we open this up you can see it’s just like a little placeholder from ms paints it’s a little derpy looking but i highly Recommend that you replace this with your own icon for the mod and you’re also going to want to change your mod id here and the package name to your mod id so remember that mod id we set up here tutorial you want to change those two things to that so We’re going to change the package here mod id right click refactor rename and change it to tutorial which is our mod id and then also down here you also want to change this to tutorial as well so this is just telling the mod that it points to this icon here it’s in assets Your mod id and then icon.png just like we have set here so yeah once you’ve done that we can come down a little bit more you can ignore environment here but you want to make sure that you change this main uh little section here this main Array so this is going to point to your main class which is our tutorial mod class in this case and it’s very important that you get this right otherwise the mod won’t know which class to run as the mod initializer so uh we want to delete this and follow our Package presentation exactly here so we have com so com and remember it starts right under the java folder so com dots technovision so techno vision dots and then the name of our mod uh folder so tutorial tutorial dot and then our main class here which is tutorial mod so tutorial mod And that’s capitalized of course because it is a a class so we’re using camelcase so yeah this is going to uh to point to your main class very important you get this rights uh for mix-ins we’re actually going to delete this line mix-ins are a little bit advanced and We’re gonna talk about them in a separate video so for now you can actually just delete this and leave this as an empty array otherwise it might throw an error if we uh we don’t have anything set there so or we set something that doesn’t exist rather Great so next we have the depends section you can leave this how it is but this is essentially specifying the minimum required version for all of these things here all these dependencies in order for the mod to run so this is just saying that the user must have at Least this fabric loader version and at least minecraft 1.19 and at least java 17 to actually run this mod so yeah that’s pretty basic but you can also add additional dependencies later on when we talk about libraries and then suggest you can pretty much just ignore this is just suggesting mods That it recommends you add as well as the mod so you can get rid of this if you want or keep it whatever you want to do it’s not very important but yeah now that that is done we should have all of our settings set so we can Get out of here and now we need to actually uh build our mappings so or generate our sources rather so to do that we can go over to our uh terminal here so go down to the bottom corner and there’s a terminal section here and we’re going to type period slash bradley gen Sources and once you’ve typed that out you can hit enter and this is going to generate the sources from fabric loom so this is going to take a while it usually takes me at least a couple minutes so i will be back when it’s done but be patient and let it load All right so you can see here that the build was successful so we can close out of this here and yeah we’re pretty much done setting up our mod now all we have to do is actually run it to make sure that everything is working so to run Your mod you can come over here to add configuration in the top right hand corner and uh if you click on application here you should see a minecraft client and a minecraft server and just like you would expect this is to allow you to run a Minecraft server with your mod and run a minecraft client with your mod so we’re going to hit minecraft client of course because we just want to run single player hit okay and you should see up here you have that uh configuration set and anytime you Want to run your mod you just make sure you click on minecraft client and hit the green triangle to run and this will actually run minecraft with your mod so it’ll take a second but i will be right back when we’re actually in the game Alright so as you can see minecraft has loaded for minecraft version 1.19 fabric and if we look at our console here you can see that there’s no major errors but you will get some of these errors here this is totally normal these specific errors here are just failing to verify your account because We’re not using a real minecraft account so don’t worry about those those are totally normal but if we actually go up here you can see the load order it’s loading all these specific modifications to the game and you can see if we scroll down here to the very bottom That right after minecraft 1.19 is loaded uh we actually load our mod so you should see your mod id and the version number and if you don’t see this here then that means that your mod did not initialize properly and you’ll have to restart this video and figure out What went wrong but yeah that means that everything is working perfectly now the last thing i’m going to do in the main class here is actually create a static string for our mod id so that we can easily access it in other classes later on so Let’s come down here in our tutorial mod main class and right above this uninitialized method i’m just going to create a public static final string and i’m going to name this mod underscore id and this is going to be equal to our mod id so if you remember in the Fabric.mod.json file here we set our mod id right here to tutorial so we’re going to copy this mod id exactly and we’re going to paste it in and yeah so now we have our mod id in our code and we can very easily just access this in other classes by using tutorial mod Dot mod id and we can just do that in any class later on all right so that’s going to do it for this episode we’ve set up our workspace and in the next episode we’re gonna actually create a custom item so thank you guys so much for watching and i will See you in the next episode you Video Information
This video, titled ‘Minecraft 1.19: Fabric Modding Tutorial – Workspace Setup (#1)’, was uploaded by TechnoVision on 2022-07-19 03:25:03. It has garnered views and [vid_likes] likes. The duration of the video is or seconds.
This tutorial series will cover building a Minecraft Mod from scratch using the Fabric API! In this episode, we setup our workspace …