Prerequisites
- Oracle JDK 21 — required by the NeoForge toolchain
- IntelliJ IDEA (Community Edition or higher) is recommended
- Lombok plugin — General Mechanics uses Lombok annotations throughout its source
- Minecraft Development plugin — recommended for NeoForge mod development
Setup
Add the GENLAB Maven repository
General Mechanics artifacts are published to the GENLAB Maven repository at
https://maven.superscary.net. Add it to your repositories block and scope it to the general.mechanics group so Gradle does not query it unnecessarily for unrelated dependencies.Declare the dependency
Add General Mechanics to your Define the version variables in your
dependencies block. Replace ${mc_version} with your target Minecraft version (e.g. 1.21.1) and ${gtm_version} with the General Mechanics release you want to target.gradle.properties:gradle.properties
Declare a mod dependency in neoforge.mods.toml
To ensure General Mechanics is present at runtime and NeoForge loads your mod after it, add a dependency entry in your Replace
META-INF/neoforge.mods.toml:neoforge.mods.toml
your_mod_id with your own mod’s ID. The General Mechanics mod ID is gm (see GM.MODID).Mod ID constant
The General Mechanics mod ID is defined as a constant on theGM interface:
ResourceLocation values that reference General Mechanics content. GM also provides a convenience method:
Registry overview
| Class | DeferredRegister type | Description |
|---|---|---|
CoreBlocks | DeferredRegister.Blocks | All GM blocks (ores, plastic blocks, machines, ice variants) |
CoreItems | DeferredRegister.Items | All GM items (tools, electrical components, plastic items, circuits) |
CoreElements | DeferredRegister.Items | Element ingots and their derived forms (raw, nugget, dust, plate, pile, rod) |
CoreFluids | DeferredRegister<Fluid> | All GM fluids (fuels, acids, gases, cryogenic liquids) |
CoreUpgrades | DeferredRegister.Items | Machine upgrade items |