It’s just a simple step guide, which is a summary of this tutorial playlist

Getting Started & Setup

  1. install the Java Development Kit, AKA JDK, you need the JDK 21 version. Make sure that in the menu custom setup the set or override JAVA_HOME variable is set to will be installed on local hard drive.
  2. Now we are going to install intellij, make sure to grab the community edition.
  3. Now we go to the fabric template generator Make sure to set version to 1.21 or 1.21.1. Make sure that Mod ID does not have any special characters, spaces or Upper case letters. Make sure to set Kotlin Programming Language to false Make sure to set Mojang Mappings to false Make sure to set Data Generation to true Make sure to set Split client and common sources to false Otherwise you might not be able to follow these steps. Then download the template.img
  4. open IntelliJ and open the folder
  5. build the project, and if you get a build successful, you can continue.
  6. if you care about the fact that in your java folder is compacted into com.martinus.avans1 instead of folders in folders, then do this side-quest:
    1. the 3 dots in the explorer menu
    2. tree appearance
    3. disable flatten modules, flatten packages and compact middle packages
  7. go to the class. it is named whatever you named your project, in my case avans1
  8. remove the content of public void onInitialize() { and the random comments
  9. rightclick the deepest package name folder. and add a new java class, and name it TutorialModelClient, and make it implement the ClientModInitializer class. Make sure to implement methods with ctrl+.
  10. go to the recourses folder, fabric.mod.json
  11. add "client": ["com.martinus.avans1.TutorialModelClient"] under "entrypoints": {
  12. Optional stuff in this json:
    • Change the description
    • change author
    • contact
    • license
    • icon
  13. go into the mixin folder and click on ExampleMixin
  14. Ctrl + leftclick on MinecraftServer.
  15. If you have the following image at the top of your screen, follow the indented steps: img
    1. open terminal (Ctrl + `)
    2. type ./gradlew genSources + Enter and wait until it is done.
    3. in the blue bar, click on Choose Sources...
    4. choose something along the lines of minecraft-merged-c2b31d572c-1.21-net.fabricmc.yarn.1_21.1.21+build.9-v2-sources.jar
      • If this doesn’t work, it could be because your project exeeds path length
  16. run it with the minecraft client.
    • if it doesn’t run because of error: illegal character: '\ufeff',
    1. open that file it mentions with notepad++
    2. go to Encoding > Convert to UTF-8 (without BOM).
    3. save the file, and try relaunching minecraft.
  17. make a github repo bla bla bla.

This was the first video summarised. It took me much longer to do cause of errors.

Actual Modding

Custom Items

This is episode 2 where we are going to take a look at creating custom items.

I was planning to write this part out in a step by step guide as well, but then I am just writing the code twice.

This episode teaches you to add an item to the mod, add an icon to it: img

here is a list of codes you can use for text formatting: img

Data generation

By the data generator, whenever I ran it for the second time I had an error where it wants to generate things that already exists. there are multiple ways to fix this:

  1. delete the generated folder, and try again. (every time you want to generate the data)
  2. Changing the gradle settings:
    1. go into the build.gradle file in the top level directory,
    2. find processResources { // something here }. Or if it doesn’t exist create it.
    3. add duplicatesStrategy = DuplicatesStrategy.INCLUDE between the {} brackets. This will overwrite it. For more info, read the gradle wiki.

Nameless Header