Guide

How to make a Forge mod

Updated October 7, 2026

Forge is the oldest big mod loader and NeoForge is its successor for newer versions. A Forge mod is a Gradle project using ForgeGradle (or NeoGradle), with a mods.toml file and content registered through deferred registers.

An example to start from.

Generate this with Codexe

Step by step

  1. 1.Choose Forge or NeoForge and the version

    For example Forge 47 for Minecraft 1.20.1, or NeoForge for 1.20.2 and newer.

  2. 2.Set up the Gradle project

    The MDK layout with ForgeGradle, the matching Gradle version and Java 17 (before 1.20.5) or 21.

  3. 3.Write mods.toml

    Mod id, version range of the loader and dependencies. A wrong loader range is the most common load error.

  4. 4.Register content

    Use DeferredRegister for items, blocks and entities, and the event bus for game events.

  5. 5.Build

    ./gradlew build; the first build downloads the toolchain and can take several minutes.

With Codexe

Describe the mod and say "Forge 1.20.1" or "NeoForge 1.21.1". Codexe writes the project, builds it with the matching setup and checks that the .jar contains mods.toml or neoforge.mods.toml.

Questions

Is MCreator easier?

MCreator builds mods visually, element by element; Codexe writes the code from a description. See Codexe vs MCreator.

Can I use a Forge mod with Fabric?

No, they are different loaders. A mod must be built for the loader you use.

Make a Forge mod

This prompt opens ready to send:

“A Forge 1.20.1 mod that adds a Ruby ore, ruby gem, ruby sword and full ruby armor, with recipes, textures, ore generation in the overworld between Y -60 and 16, and English names.”

Generate this with Codexe
How to make a Forge or NeoForge mod | Codexe