Creating new items is one of the key starting points for most mods. In this tutorial we will create a basic item with a model and texture, add it to a custom creative tab, and give it a display name, all from the shared common module.
RegistrationProvider throughout this guide.Creating the Item Registry
Create a new class called ItemRegistry inside a registry package in your common project. The full class path will look something like com.example.examplemod.registry.ItemRegistry.
Inside the class, define an empty public static void init() method. We will call this later from CommonClass to ensure the class is loaded and all items registered at the right time. Then declare a RegistrationProvider for the item registry:
The getItemProperties() helper returns a fresh Item.Properties instance. You can expand this method later to apply common defaults (e.g. stack size, rarity) that should apply to all your mod's items.
Registering an Item
Add a public static final field for your first item. For this tutorial we will create a simple item called Iron Stick:
Next, call ItemRegistry.init() from your CommonClass so the field is resolved when the mod initialises:
Item Model and Texture
Create the item model JSON in your common project under src/main/resources/assets/examplemod/models/item/iron_stick.json:
The item/generated parent is the standard flat 2D item model. The layer0 texture key points to your texture file.
Next, create a 16×16 PNG texture and save it at src/main/resources/assets/examplemod/textures/item/iron_stick.png. Replaceexamplemod throughout with your own mod ID if you changed it.
Language File
Create (or open) the English language file at src/main/resources/assets/examplemod/lang/en_us.json and add a display name for your item:
For any further entries you add to this file, remember to place a comma after each entry except the last. To support other languages, copy this file and rename it with the appropriate Minecraft language code.
Adding a Creative Tab
Rather than cluttering ItemRegistry, create a dedicated CreativeTabRegistry class in the same package:
Call CreativeTabRegistry.init() from CommonClass.init() alongside your item registry call. Then add the tab's translation key to your language file:
Testing In-Game
Run either the Fabric Client or NeoForge Client run configuration. Open creative mode, find your new tab, and check that your Iron Stick appears. You can also use the give command to test it directly:
You can find the source for this tutorial here:
View Source on GitHubCreating Blocks (MultiLoader 1.21+)
Create a BlockRegistry with registerBlock helpers that auto-register a BlockItem, define a custom block using vanilla property copying, set up block models, textures, blockstates, and a creative tab.
Continue →