Minecraft Modding Tutorials

Learn the basics, explore advanced techniques, and create mods that transform your Minecraft world. These step-by-step tutorials are designed to make getting into modding Minecraft a bit easier!

Star Fork Follow @ryankshah

Setting Up RegistrationUtils ‐ MultiLoader 1.21+


RegistrationUtils is a Gradle plugin providing registration utilities for Minecraft multi-loader projects. The plugin installs the dependency and shadows it in your mod's jar file when you build your mod, so you won't have to declare any hard dependencies. Plus, it makes life much easier in multi-loader when registering different things across NeoForge and Fabric!


First, you will need to navigate to your build.gradle file in your root directory, and add the line to the plugins block:

id 'com.matyrobbrt.mc.registrationutils' version '$regVersion'

Where it says $regVersion, you will want to replace this with the latest version of RegistrationUtils for the version of Minecraft, which you can find here. For this tutorial, we will be using version 1.21.0-0.2.1.

Next, you will want to copy this block into the same file:

        
            registrationUtils {
                group 'com.example.examplemod.registration'
                projects {
                    fabric { type 'fabric' } // The fabric project
                    neoforge { type 'neoforge' } // The neoforge project
                    common { type 'common' } // The common project
                }
            }
        
        

The group property here should be the same group you defined early, and it will build the necessary files for you in the registrations package in this group.

Once you have completed this, refresh the gradle project in IntelliJ IDEA using the refresh button in the gradle tab. You can see the final setup example by viewing the GitHub source for this tutorial above.


You can find the source for this tutorial here:

View Source