-
Notifications
You must be signed in to change notification settings - Fork 0
How To Add Mods As A External Library Tutorial
This tutorial will guide new developers through the process of adding mods and libraries as an API to their project using IntelliJ IDEA. The screenshots and instructions reflect the latest IntelliJ IDEA version (using the new UI). This is particularly useful when developing addons for Mysterium Fateboxes.
The best way to add a local mod JAR as a dependency is by defining it in your build.gradle file. This ensures your changes persist when Gradle syncs.
-
Open your project in IntelliJ IDEA.

-
Open your
build.gradlefile and navigate to thedependenciesblock.
-
Add the dependency using
implementation files(...). It is good practice to define the path to your library folder and the library name as variables.var path : String = "E:\\Workspace\\Minecraft\\MysteriumFateboxes\\NeoForge 26.2\\MysteriumFateboxes\\build\\libs\\" var lib : String = "mysteriumfateboxes-1.0.8-release.jar" var libPath = path + lib implementation files(libPath)

-
Sync Gradle Changes. In the top right of your editor, click the Gradle Sync icon to apply the changes and ensure the IDE recognizes the new library.

You can also manually add or verify dependencies through the Project Structure menu. Note that if you only do this without updating build.gradle, your changes might be lost the next time Gradle syncs.
-
Open File > Project Structure (or press
Ctrl+Alt+Shift+S) and navigate to Modules > Dependencies. Click the+icon to add a new dependency.
-
Select "2 Library..." (or "JARs or Directories..." if you haven't defined it as a library yet).

-
Choose the library you wish to add (e.g.,
mysteriumfateboxes-1.0.8-release) and click Add Selected.
-
Verify that the library now appears in your dependencies list under the Compile scope. You might see a warning about changes being lost after reimporting—this is normal and reminds you to also update
build.gradle.

-
Click Apply and OK.
Note: There is one more image pending from the developer to be added to this tutorial.