Skip to content
Platforms

Forge mods

Forge (and NeoForge) mods with Codexe. Versions, what to put in the request, the ForgeGradle build, mods.toml and common issues.

Updated

On this page
  1. What to put in the request
  2. What Codexe generates
  3. Build and verification
  4. Common issues

Forge is the long-established mod loader with a large event bus and registry system. Codexe generates a complete Gradle project using ForgeGradle.

#What to put in the request

  • Minecraft and Forge version: "Forge 1.20.1". Without one, Minecraft 1.20.1 with Forge 47 is used.
  • NeoForge: if you want NeoForge (1.20.2+), say so explicitly. Codexe recognises NeoForge projects and builds them with the matching Gradle setup.
  • Content: items, blocks, entities, creative tabs, recipes, configs, and whether anything is client-side.
Text
A Forge 1.20.1 mod: adds a "Copper Hammer" tool (durability 250) that mines a 3x3 area of stone-type blocks. Crafted from copper ingots and sticks. Registered with DeferredRegister, added to the Tools creative tab, English lang file.

#What Codexe generates

  • build.gradle, gradle.properties and settings.gradle with the right ForgeGradle and Gradle versions.
  • META-INF/mods.toml (or neoforge.mods.toml) declaring the mod id, loader range and dependencies.
  • The @Mod entry class, DeferredRegister registries and event subscribers.
  • Assets: lang, models, placeholder textures.

#Build and verification

The mod is compiled before it's Ready, and the JAR must contain mods.toml, neoforge.mods.toml or mcmod.info. Java is chosen from the Minecraft version (17 before 1.20.5, 21 from 1.20.5). The first build downloads the Forge toolchain and can take several minutes. Mod builds stop after 10 minutes.

#Common issues

SymptomLikely cause
"Mod file … needs language provider javafml"The loader version range in mods.toml doesn't match your Forge version. State your exact Forge version.
Registry errors at startupObjects registered outside DeferredRegister. Ask the chat to move them.
Works in singleplayer, crashes on a serverClient-only classes referenced from common code.
Forge mods | Codexe Docs