Error= Caused by: java.lang.IllegalStateException: Cannot register new entries to DeferredRegister after RegisterEvent has been fired.
Cause=
package net.hazza.hazzasmod.block; import net.hazza.hazzasmod.HazzasMod; import net.hazza.hazzasmod.item.ModItems; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.Item; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.state.BlockBehaviour; import net.minecraft.world.level.material.Material; import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.registries.DeferredRegister; import net.minecraftforge.registries.ForgeRegistries; import net.minecraftforge.registries.RegistryObject; import java.util.function.Supplier; public class ModBlocks { public static final DeferredRegister<Block> BLOCKS = DeferredRegister.create(ForgeRegistries.BLOCKS, HazzasMod.MOD_ID); public static final RegistryObject<Block> YELLOW_WALLPAPER_BLOCK = registerBlock("yellow_wallpaper_block", () -> new Block(BlockBehaviour.Properties.of(Material.WOOD) .strength(3f).requiresCorrectToolForDrops())); private static <T extends Block> RegistryObject<T> registerBlock(String name, Supplier<T> block) { RegistryObject<T> toReturn = BLOCKS.register(name, block); registerBlockItem(name, toReturn); return toReturn; } private static <T extends Block>RegistryObject<Item> registerBlockItem(String name, RegistryObject<T> block) { return ModItems.ITEMS.register(name, () -> new BlockItem(block.get(), new Item.Properties())); } public static void register(IEventBus eventBus) { BLOCKS.register(eventBus); } }