Overview

Simple multiplatform block and item registration.

In your central mod (the one that extends AbstractMod ), call registerItem and registerBlock.

Registering a Block

Pass the registerBlock method a string name and a BlockContainer instance for your block.

BlockContainer

blockBuilder

The block builder is a function that returns an instance of a block or something that extends block. I tried making this just a block, but NeoForge didn’t like that as it wasn’t immediately registered… I think. Changed it to this and it went smooth as butter, just a little awkward because if you need to get to the actual block, you have to ask the container instance for the block (don’t do this until after registration).

itemProperties

Properties for the BlockItem for the block. Ignored if you set ignoreItem to true. Defaults to the default item properties.

ignoreItem

If you set this to true (false by default), no BlockItem will be created for the block.

tab

The CreativeModeTab or ItemGroup this block (technically its BlockItem) should be added to.

BlockContainer.Basic

A simpler version of the BlockContainer for simple blocks. Just feed it some block properties instead of a block builder, and it’ll make the block builder for you.

Registering an Item

Pass the registerItem method a string name and an ItemContainer instance for your item.

ItemContainer