Posted February 17, 20169 yr Hello! Well, I've been following Wuppy's modding tutorial and Eclipse has thrown me an error. I cannot seem to find what I'm missing. I made a new class and my intention is to define the new class in the main one. package com.aphex.tutorial; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; @Mod(modid = AphexMod.MODID, version = AphexMod.VERSION) public class AphexMod { public static final String MODID = "aphexmod"; public static final String VERSION = "1.0"; @EventHandler public void preInit(FMLPreInitializationEvent event) { } @EventHandler public void init(FMLInitializationEvent event) { AphexMod.addRecipes(); /* Error lies here */ } @EventHandler public void postInit(FMLPostInitializationEvent event) { } } Here is the main class ^^ package com.aphex.tutorial; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fml.common.registry.GameRegistry; public class AphexRecipe { public static void addRecipes() { GameRegistry.addRecipe(new ItemStack(Items.oak_door, 1), " WW", "W ", " W", 'W', new ItemStack(Items.iron_ingot)); GameRegistry.addSmelting(new ItemStack(Items.oak_door), new ItemStack(Items.diamond_sword, 1), 1F); } } ^^ The recipe class. Error - "The method addRecipes() is undefined for the type AphexMod. Any help appreciated.
February 17, 20169 yr You're trying to call AphexMod.addRecipes ; but AphexMod doesn't have an addRecipes method, AphexRecipe does. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
February 17, 20169 yr Author Thank you so much, Choonster! It's embarrassing to admit that the tutorial does in fact show this. My only excuse is that it's 5.30am!
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.