public class ExampleMod implements ModInitializer { public static final Block EXAMPLE_BLOCK = register("example_block", Block::new, Block.Settings.create().strength(4.0f)); private static Block register(String path, Function factory, AbstractBlock.Settings settings) { final Identifier identifier = Identifier.of("tutorial", path); final RegistryKey registryKey = RegistryKey.of(RegistryKeys.BLOCK, identifier); final Block block = Blocks.register(registryKey, factory, settings); Items.register(block); return block; } }