-
Notifications
You must be signed in to change notification settings - Fork 0
Creating your mod
Since Avoid supports multiple modloaders, it also has a connected way of creating mods that use its API.
Here's how you can make a mod with it:
1. Setting up your project
(Prerequisites: IntelliJ IDEA)
-
Create a new Java project in your IDE.
As the build system, pickGradle
with the version9.2.0. -
Download the newest Avoid jar for your desired Minecraft version.
You can do this on Avoid's Modrinth page. -
Drag the newest Avoid jar onto a new directory called
libsin your IDE into your project root.
After moving it there, right-click on it and selectAdd As Library...(Project Library, OK). -
Double-click on the
build.gradle(.kts)in your project root in your IDE.
Then, copy the following text and paste it in the place of thedependenciessection:
dependencies { testImplementation(platform("org.junit:junit-bom:5.10.0")) testImplementation("org.junit.jupiter:junit-jupiter") testRuntimeOnly("org.junit.platform:junit-platform-launcher") compileOnly(fileTree(rootProject.file("libs"))) }
-
Finally, sync your project by clicking the Gradle-sync icon in the top-right corner of your IDE.
If it doesn't appear, click Shift 3 times, selectActionsand search forSync All.
Then, click onSync All Gradle Projects.
2. Creating AvoidLib mod structure
After your project is ready to operate, we still have something left to do.
That is, actually making a mod with the AvoidLib jar in our possesion.
-
In the
src/main/javadirectory of your project root, create a package, like:com.example.exmod.
In that package, create a file calledExampleMod.
Then, paste the following content onto it:package com.example.exmod; import pl.olafcio.avoid.mods.AvoidMod; public class ExampleMod extends AvoidMod { @Override public void onEnable() { System.out.println("Enabled ExampleMod!"); } }
-
In the
src/main/resourcesdirectory of your project root, create a file calledavoid.mod.json.
Then, paste the following content onto it:{ "__schema": 1, "id": "testmod", "version": "1.0", "version-system": "semver", "name": "TestMod", "author": "Me", "description": "An example mod made with AvoidLib.", "main-class": "com.example.exmod.ExampleMod" }In this snippet, however, there are placeholders you need to fill in.
Replace:- the id (
testmod) with your mod ID (which is essentially its name without spaces or special characters), - the name (
TestMod) with your mod name (used for displaying in the GUI and identifying the mod to users), - the author (
Me) with your nickname, - the description (
An example mod with AvoidLib.) with your mod description, - the main class (
com.example.exmod.ExampleMod) with the package name combined with the structure name of your main mod class.
- the id (
3. Testing your mod
(Prerequisites: IntelliJ IDEA)
Unfortunately, there's not yet a built-in way to test your Avoid mod without adding it to your Minecraft instance.
To do that, however, we need to make a .jar of your Avoid mod - which is called building. Here's how to do it:
-
Click on the
Current Filetext on the menubar of your IDE:

-
Click on the
Edit Configurations...button in the context menu that opened:

-
Click on the plus icon in the window that opened:

-
Select
Gradle:

-
Check
Store project fileand set the command asbuild --no-rebuild:

-
Click
OK:

Now, you can build your mod by clicking the new appeared option:

©️ Copyright 2026 Olafcio (on behalf of the AvoidLib org)
📝 Licensed with CC BY-NC (Attribution-NonCommercial)
Avoid Framework
🏚️ 1. Home
📽️ 2. Creating your mod
🌄 3. Adding assets to your mod
🧊 4. Creating a block
✏️ 5. Creating an item
🎯 6. Creating an entity selector
🤖 7. Creating a command