How to make a new item in a Minecraft mod
An item is registered once in the game’s item registry. It needs an item model and a 16x16 texture to show, an English name, and a place in a creative tab so players can find it.
Works on Minecraft 1.20.1 to 26.3 on NeoForge; Minecraft 1.16.5 to 26.3 on Fabric; Minecraft 1.16.5 to 1.20.1 on Forge; Minecraft 1.12.2 on Forge. Each example was compiled against its loader and version before it shipped in Linen.
- Register the item in your items class (with its Item.Properties on 1.13 and newer).
- Add its item model JSON and a 16x16 texture.
- Give it an English name in the lang file (en_us.json, or en_us.lang on 1.12.2).
- Put it in a creative tab.
For each loader and version
Section titled “For each loader and version”The example mod is examplemod in the package com.example.examplemod. Use your own mod id and package.
Fabric 1.16.5 to 1.21
Section titled “Fabric 1.16.5 to 1.21”Uses:
Registry.registerBuiltInRegistries.ITEMItem.PropertiesItemGroupEvents.modifyEntriesEvent
NeoForge 1.20.1 to 1.21, Forge 1.17.1 to 1.20.1
Section titled “NeoForge 1.20.1 to 1.21, Forge 1.17.1 to 1.20.1”Uses:
DeferredRegister.createForgeRegistries.ITEMSRegistryObjectItem.PropertiesBuildCreativeModeTabContentsEvent
Fabric 1.21.1
Section titled “Fabric 1.21.1”Uses:
Registry.registerBuiltInRegistries.ITEMItemItem.PropertiesItemGroupEvents.modifyEntriesEvent
NeoForge 1.21.1
Section titled “NeoForge 1.21.1”Uses:
DeferredRegister.createItemsDeferredRegister.Items.registerSimpleItemDeferredItemItem.PropertiesBuildCreativeModeTabContentsEvent
Fabric 26.3
Section titled “Fabric 26.3”Uses:
Registry.registerBuiltInRegistries.ITEMResourceKey.createItem.Properties.setIdItemGroupEvents.modifyEntriesEvent
From 1.21.4 the item also needs a client item definition, assets/<mod_id>/items/<name>.json, that points at its model.
Fabric 1.21.2 to 26.2
Section titled “Fabric 1.21.2 to 26.2”Uses:
Registry.registerBuiltInRegistries.ITEMItemItem.PropertiesItemGroupEvents.modifyEntriesEvent
From 1.21.4 the item also needs a client item definition, assets/<mod_id>/items/<name>.json, that points at its model.
NeoForge 1.21.2 to 26.3
Section titled “NeoForge 1.21.2 to 26.3”Uses:
DeferredRegister.createItemsDeferredRegister.Items.registerSimpleItemDeferredItemItem.PropertiesBuildCreativeModeTabContentsEvent
From 1.21.4 the item also needs a client item definition, assets/<mod_id>/items/<name>.json, that points at its model.
Forge 1.16.5
Section titled “Forge 1.16.5”Uses:
DeferredRegister.createForgeRegistries.ITEMSRegistryObjectItem.Properties.tabItemGroup
Forge 1.12.2
Section titled “Forge 1.12.2”Uses:
RegistryEvent.Register<Item>Item.setRegistryNameItem.setUnlocalizedNameItem.setCreativeTabModelLoader.setCustomModelResourceLocation
In 1.12.2 an item is registered in a RegistryEvent.Register<Item> handler (event.getRegistry().register(item)) with setRegistryName and setUnlocalizedName; its model is set with ModelLoader in a ModelRegistryEvent handler, and it joins a creative tab with setCreativeTab.
Sources
Section titled “Sources”- https://docs.fabricmc.net/1.21.1/develop/items/first-item
- https://docs.neoforged.net/docs/1.21.1/items/
Related how-tos
Section titled “Related how-tos”In Linen
Section titled “In Linen”Linen’s How-tos library has this page too, with the example for your own mod’s loader and Minecraft version. Hover a name in your code and Linen points to the how-tos that explain it. Both are free. Download Linen.