Skip to content

Neoforge

The com.possible-triangle.neoforge plugin is an abstract layer around NeoForge's ModDevGradle.

Like the other loader plugins, it tries to align with a common API interface, to make migration & sharing between them easier.

There are some neoforge-only values, which fallback to gradle properties

Property Default Value
neoforgeVersion gradle.properties: neoforge_version
kotlinForgeVersion (1) gradle.properties: kotlin_forge_version
  1. read more about kotlin support

Access Transformers

The neoforge extension provides several ways to enable access transformers for the subproject.

It is also possible to use Access Wideners, which will be transformed by the plugin into a access transformer (1).

  1. for debugging purposes the generated access transformer can be found under build/generated/accesstransformer.cfg

Warning

This functionality is still a bit experimental. While it should always work, even in clean environments, sometimes the access transformer is not generated in time for the IDE sync. That means, that after running clean, or when cloning a fresh repository using this, you may need to sync gradle twice.

build.gradle.kts
neoforge {
   // default path at <project-path>/src/main/resources/META-INF/accesstransformer.cfg
   accessTransformer()
   accessTransformer(project(":other-sub-project"))
   // custom file path
   accessTransformer(file("..."))

   // uses `com.possible-triangle.access` to transform access widener files
   accessWidener(project(":fabric"))
}

Jar-In-Jar

Mods & Libraries included using the mod extension, will be bundled using neoforge's Jar-In-Jar system.

Datagen

Like other loaders, it can be configured using the dataGen method on the neoforge extension. Everything else follows the same standard API as the other loaders.