Skip to content

How to make a new block in a Minecraft mod

A block is registered once in the game’s block registry with its properties, and a block item lets players hold and place it. It also needs a blockstate file, a block model, an item model, a 16x16 texture, a loot table so it drops itself, and an English name.

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.

  1. Register the block with its properties in your blocks class.
  2. Register a block item for it in your items class.
  3. Add its blockstate, block model and item model, and a 16x16 texture.
  4. Add a loot table so it drops itself when mined.
  5. Give it an English name in the lang file (en_us.json, or en_us.lang on 1.12.2).

The example mod is examplemod in the package com.example.examplemod. Use your own mod id and package.

Uses:

  • Registry.register
  • BuiltInRegistries.BLOCK
  • BuiltInRegistries.ITEM
  • BlockBehaviour.Properties.of
  • BlockItem

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.create
  • ForgeRegistries.BLOCKS
  • ForgeRegistries.ITEMS
  • RegistryObject
  • BlockBehaviour.Properties.of

Uses:

  • DeferredRegister.createBlocks
  • DeferredRegister.Blocks.registerSimpleBlock
  • DeferredRegister.Items.registerSimpleBlockItem
  • DeferredBlock
  • BlockBehaviour.Properties.of

Uses:

  • Registry.register
  • BuiltInRegistries.BLOCK
  • ResourceKey.create
  • BlockBehaviour.Properties.setId
  • BlockBehaviour.Properties.of
  • BlockItem

Uses:

  • DeferredRegister.create
  • ForgeRegistries.BLOCKS
  • RegistryObject
  • AbstractBlock.Properties.of
  • BlockItem
  • Item.Properties.tab

Uses:

  • RegistryEvent.Register<Block>
  • Block.setRegistryName
  • Block.setUnlocalizedName
  • ItemBlock
  • Block.setCreativeTab

In 1.12.2 a block is registered in a RegistryEvent.Register<Block> handler (event.getRegistry().register(block)) with setRegistryName and setUnlocalizedName; its item is an ItemBlock registered in the item event, and both need a model (blockstate JSON, ModelLoader for the item).

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.