Skip to content

Automated Registry

wrldmap edited this page Oct 6, 2025 · 3 revisions

The automated registry process is one of the more complicated parts of the mod. Let's walk through it!

Material definitions

Materials are defined through a series of parameters. In MaterialDef.java, you can find all of these parameters. The actual materials are defined in ModMaterials.java, using the format shown here:

        MaterialDef.of("<Name of material>", 0x<Hex code of material>, <Pickaxe type, explained in MaterialDef. It's an int, btw.>, "<Material set. Currently this doesnt do anything, so just put 'metallic'.>").<any and all parameters>;

So, a fully functioning material definition looks like this.

        MaterialDef.of("zinc", 0xC2E6D5, 1, "metallic")
            .noGemstone()
            .noNetherOre()
            .noEndOre(),

Material-based item and block registry

After the material is registered with it's parameters, that is then sent to ModRegistries.java to process the items and blocks. It does this by setting a form, passing through the material, and then passing those parameters into registry.

Registry is pretty simple, as it just uses DeferredRegister. I currently have the blocks and items registering through a set of custom classes, TintableMaterialBlock.java and TintableMaterialItem.java respectively, for ease of sorting later.

Creative Tab Shenanigans

Probably the simplest part of the registry process. Find the code at ModCreativeTabs.java, but basically it just finds every Item and BlockItem from the mod and adds it to the tab.

Clone this wiki locally