Jump to content

[SOLVED] Error Registering Item


Miqhtie

Recommended Posts

Hey,

I am following a tutorial on forge and the tutorial is from forge 1.10, I am coding in the 1.12 version but ran into an error.

 

Error:

Caused by: java.lang.NullPointerException: Can't use a null-name for the registry, object net.minecraft.item.Item@2fd1f0e4.

Code:

public class ModItems {

    public static Item sumersHead;


    public static void preInit(){
        sumersHead = new Item().setUnlocalizedName("sumers_head").setCreativeTab(FirstMod.tabFirst);

        registerItems();
    }

    public static void registerItems()
    {
        ForgeRegistries.ITEMS.register(sumersHead);
    }

    public static void registerRenders()
    {

    }

    public static void registerRender(Item item)
    {
        Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(FirstMod.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
    }

}

 

Edited by Miqhtie
Change of name.
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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