It’s just a simple step guide, which is a summary of this tutorial playlist
Getting Started & Setup
- install the Java Development Kit, AKA JDK, you need the JDK 21 version.
Make sure that in the menu
custom setup
theset or override JAVA_HOME
variable is set towill be installed on local hard drive
. - Now we are going to install intellij, make sure to grab the community edition.
- Now we go to the fabric template generator
Make sure to set version to
1.21
or1.21.1
. Make sure thatMod ID
does not have any special characters, spaces or Upper case letters. Make sure to setKotlin Programming Language
tofalse
Make sure to setMojang Mappings
tofalse
Make sure to setData Generation
totrue
Make sure to setSplit client and common sources
tofalse
Otherwise you might not be able to follow these steps. Then download the template. - open IntelliJ and open the folder
- build the project, and if you get a
build successful
, you can continue. - 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:- the 3 dots in the explorer menu
- tree appearance
- disable
flatten modules
,flatten packages
andcompact middle packages
- go to the class. it is named whatever you named your project, in my case
avans1
- remove the content of
public void onInitialize() {
and the random comments - rightclick the deepest package name folder. and add a new java class, and name it
TutorialModelClient
, and make it implement theClientModInitializer
class. Make sure to implement methods withctrl
+.
- go to the recourses folder, fabric.mod.json
- add
"client": ["com.martinus.avans1.TutorialModelClient"]
under"entrypoints": {
- Optional stuff in this json:
- Change the description
- change author
- contact
- license
- icon
- go into the mixin folder and click on
ExampleMixin
Ctrl
+leftclick
onMinecraftServer
.- If you have the following image at the top of your screen, follow the indented steps:
- open terminal (Ctrl + `)
- type
./gradlew genSources
+ Enter and wait until it is done. - in the blue bar, click on
Choose Sources...
- 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
- run it with the minecraft client.
- if it doesn’t run because of
error: illegal character: '\ufeff'
,
- open that file it mentions with notepad++
- go to Encoding > Convert to UTF-8 (without BOM).
- save the file, and try relaunching minecraft.
- if it doesn’t run because of
- 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:
here is a list of codes you can use for text formatting:
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:
- delete the
generated
folder, and try again. (every time you want to generate the data) - Changing the gradle settings:
- go into the build.gradle file in the top level directory,
- find
processResources { // something here }
. Or if it doesn’t exist create it. - add
duplicatesStrategy = DuplicatesStrategy.INCLUDE
between the{}
brackets. This will overwrite it. For more info, read the gradle wiki.