This code add the Block to MC:
public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, xpmod.MOD_ID);
public static final RegistryObject<Block> TEST_BLOCK = BLOCKS.register("test_block",
()->new Block(AbstractBlock.Properties.create((Material.IRON), MaterialColor.IRON)
.hardnessAndResistance(0.5f, 0).harvestTool(ToolType.PICKAXE).harvestLevel(2).sound(SoundType.STONE)));
and other code is default