Today, I wanted to add a mod for development purposes without manually placing it in the run folder. I discovered that I could use Gradle to add mods more easily. This should work on Intellij IDEA and Eclipse.

Steps to Add Mods for Development Purposes (or Mods your Mod Depends on)

1. Locate your build.gradle file:

In your build.gradle file, look for a section called dependencies. If it’s not there, you can add it manually:

dependencies {
	runtimeOnly "curse.maven:item-collectors-395620:6018121"
}

In this example we added the Item Collectors mod. https://www.curseforge.com/minecraft/mc-mods/item-collectors

Here’s what each part means:

2. Refresh Gradle in your IDE:

After adding the dependency, an option to refresh Gradle should appear in your IDE. Click on it to refresh.

3. Launch your client:

Once Gradle is refreshed, you can launch your client, and the mod should be available.

This method is not only useful for adding mods for development purposes but also for adding dependencies your mod needs.

I hope this guide helps you!