Jump to content

(modname) (modname) encountered an error during the load_registries event phase null (FIXED)


DeadPug

Recommended Posts

Hello i am a new developer and i am having the issue in the title this is the main file please tell me if you know whats wrong please help me! there are many fixes to the problem but none i have found works! 1.14.4 (FIXED)


 

Spoiler

 

package olav.OlavMod;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import net.minecraft.block.Block;
import olav.OlavMod.lists.BlockLists;
import olav.OlavMod.lists.ItemLists;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;

import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;

import net.minecraft.util.ResourceLocation;

import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;

import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;

@Mod("olav")
public class OlavMod {

    public static OlavMod instance;
    public static final String modid = "olav";
    private static final Logger logger = LogManager.getLogger(modid);
    
    public OlavMod() {
        
        instance = this;
        
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup);
        FMLJavaModLoadingContext.get().getModEventBus().addListener(this::clientRegistries);
        
        MinecraftForge.EVENT_BUS.register(this);
    }
    
    private void setup(final FMLCommonSetupEvent event) {
        logger.info("Setup method registered successfully.");
    }
    
    private void clientRegistries(final FMLClientSetupEvent event) {
        logger.info("ClientRegistries method registered succsessfully.");
    }
    @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD)
    public static class RegstryEvents {
        @SubscribeEvent
        public static void registerItems(final RegistryEvent.Register<Item> event) {
            
            event.getRegistry().registerAll
            (
            ItemLists.oranium_sword = new Item(new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("oranium_sword")),
            
            ItemLists.oranium_block = new BlockItem(BlockLists.oranium_block, new Item.Properties().group(ItemGroup.BUILDING_BLOCKS)).setRegistryName(BlockLists.oranium_block.getRegistryName())
            );
            logger.info("Items registered");
        }
        
        public static void registerBlocks(final RegistryEvent.Register<Block> event) {
            
            event.getRegistry().registerAll
            (
                BlockLists.oranium_block = new Block(Block.Properties.create(Material.IRON).hardnessAndResistance(5f).harvestLevel(4).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE)).setRegistryName(location("oranium_block"))
            );
            logger.info("Blocks registered");
        }
        
        private static ResourceLocation location(String name) {
            return new ResourceLocation(modid, name);
        }
    }
}
 

the pictures are the red errors?

 

 

log1.PNG

Log2.PNG

log3.PNG

Edited by DeadPug
Link to comment
Share on other sites

You should make a github repository for your code/project, much easier for people to read from there :)

If you must post here, you should use spoiler tags (the eyeball button in the forum editor) so there isn't a huge wall of text.

 

In order to provide more help, you should always post logs as described in the EAQ (also using spoiler tags). If the log is too long, use a github gist or another service to host the log, and post the link here.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.