public class ExampleMod implements ModInitializer { // For versions before 1.21, replace `Identifier.of` with `new Identifier`. public static final Block BOX_BLOCK = Registry.register(Registries.BLOCK, Identifier.of("tutorial", "box_block"), new BoxBlock(AbstractBlock.Settings.copyOf(Blocks.CHEST))); public static final BlockItem BOX_BLOCK_ITEM = Registry.register(Registries.ITEM, Identifier.of("tutorial", "block"), new BlockItem(BOX_BLOCK, new Item.Settings())); public static final BlockEntityType BOX_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, Identifier.of("tutorial", "box_block"), BlockEntityType.Builder.create(BoxBlockEntity::new, BOX_BLOCK).build()); // In 1.17 use FabricBlockEntityTypeBuilder instead of BlockEntityType.Builder // public static final BlockEntityType BOX_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier("tutorial", "box_block"), // FabricBlockEntityTypeBuilder.create(BoxBlockEntity::new, BOX_BLOCK).build(null));; @Override public void onInitialize() { } }