Hey all, so I have some basic knowledge regarding java, like object creation, methods, variables, and properties. I learned from Khan Academy, if that knowledge is of any use.
Anyway, I am following Crayfish's tutorial for adding items to Minecraft, and for some reason, I can set the unlocalized name, but not the registry name for the item, because it says I haven't defined the method for setRegistryName. My code is below. The ItemMango class contains a couple methods, which set the unlocalized name, and the registry name. My Reference class clearly defines the method for the registry name, but I still get an error. I would greatly appreciate any help.
Thanks
package com.Atirath.Main.items;
import com.Atirath.Main.Reference;
import net.minecraft.item.Item;
public class ItemMango extends Item {
public ItemMango() {
setRegistryName(Reference.MainItems.MANGO.getRegistryName());
setUnlocalizedName(Reference.MainItems.MANGO.getUnlocalizedname());
}
}
package com.Atirath.Main;
import com.Atirath.Main.init.ModItems;
import com.Atirath.Main.proxy.CommonProxy;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.Mod.Instance;
import net.minecraftforge.fml.common.SidedProxy;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
public class Main {
@Instance
public static Main instance;
@SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
public static CommonProxy proxy;
@EventHandler
public void preInit(FMLPreInitializationEvent event){
System.out.println("Pre Init");
ModItems.init();
ModItems.register();
}
@EventHandler
public void init(FMLInitializationEvent event){
System.out.println("Init");
proxy.init();
}
@EventHandler
public void postInit(FMLPostInitializationEvent event){
System.out.println("Post Init");
}
}