Posted December 12, 201410 yr Hi all I created a basic recipe mod that makes a shapeless recipe. The shapeless recipe is 2 yellow flowers = 1 stone sword. This was just a generic test I was doing to see if I wrote it all correct. Anywho, I was wondering once I write the code, how do I make it run? I see it listed under mods in the main screen but it doesn't have a disable option or anything. Thanks
December 12, 201410 yr Congratulations, it's running! Unless you made a coding error, your recipe works! Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
December 12, 201410 yr Could we see your source code? http://www.slothygaming.com/img/ota.png[/img] If your grammar is shit and you blatantly don't know what you're doing, I will not help you.
December 12, 201410 yr Author here ya go. i changed it to sand and made it not shapeless to try and it still doesnt work. package com.xenios.testmod; import net.minecraft.enchantment.Enchantment; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.WeightedRandomChestContent; import net.minecraftforge.common.ChestGenHooks; import net.minecraftforge.common.DungeonHooks; 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.registry.GameRegistry; @Mod(modid = TestMod.MODID, version = TestMod.VERSION) public class TestMod { public static final String MODID = "xenios_testmod"; public static final String VERSION = "1.0 Alpha"; @EventHandler public void init(FMLInitializationEvent event) { // recipes GameRegistry.addRecipe(new ItemStack(Items.apple), "XXX", "XXX", "XXX", 'X', Blocks.leaves); GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 2, 1), Items.redstone, new ItemStack(Items.dye, 1, 1)); // TEST GameRegistry.addRecipe(new ItemStack(Items.stone_sword, 1), "XX", 'X', Blocks.sand); net.minecraftforge.fml.common.registry.GameRegistry.addSmelting( Blocks.stone, new ItemStack(Blocks.stonebrick), 0.1F); ItemStack enchantedSwordItemStack = new ItemStack(Items.stone_sword); enchantedSwordItemStack.addEnchantment(Enchantment.sharpness, 1); net.minecraftforge.fml.common.registry.GameRegistry.addShapelessRecipe( enchantedSwordItemStack, Items.flint, Items.stone_sword); // Dungeon changes DungeonHooks.removeDungeonMob("Spider"); ChestGenHooks.removeItem(ChestGenHooks.DUNGEON_CHEST, new ItemStack( Items.saddle)); ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent( new ItemStack(Blocks.cobblestone), 25, 50, 10)); } }
December 12, 201410 yr Author I have a book i got from barnes and noble i am following that teaches modding. i dont have any syntax errors so it all appears good. The sand = swords part i threw in there myself since sand is easy to come by and i wanted to test the mod to see if i did it properly.
December 12, 201410 yr Do the other recipes work? http://www.slothygaming.com/img/ota.png[/img] If your grammar is shit and you blatantly don't know what you're doing, I will not help you.
December 12, 201410 yr Author I havent tried. Do i need to start anew world or can i keep the current ones going?
December 12, 201410 yr You can keep the current one. http://www.slothygaming.com/img/ota.png[/img] If your grammar is shit and you blatantly don't know what you're doing, I will not help you.
December 12, 201410 yr Author Alright. I havent tired the others, but the sand and flowers didnt work. I honestly am new to minecraft, i got it so i can mod for fun and for educational purposes, so i might be doing something wrong. I dont think i am though.
December 12, 201410 yr Author It gives me an output of gold a lot though i noticed. I am using forge for 1.8
December 12, 201410 yr Oh, I don't know much of all about Forge for 1.8. I wish you specified. Sorry, I can't be of much help today. http://www.slothygaming.com/img/ota.png[/img] If your grammar is shit and you blatantly don't know what you're doing, I will not help you.
December 12, 201410 yr Why do you do GameRegistry.xyz(); at one time and the line below you do net.minecraftforge.fml.common.registry.GameRegistry.abc() ? Maybe your inports are broken? Otherwise after a quick testing it works for me... Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
December 12, 201410 yr I have the little impresion youar putting the recipe on init() , but must be in preinit() @Mod.EventHandler public void preInit(FMLPreInitializationEvent event) { Configuration config = new Configuration(event.getSuggestedConfigurationFile()); MercenaryModBlocks.init(); MercenaryModItems.init(); MercenaryModRecipes.init(); FMLCommonHandler.instance().bus().register(new mercenarymod.utilidades.KeyInputHandler()); mercenarymod.utilidades.KeyBindings.init(); //KeyInputHandler }
December 13, 201410 yr Author Why do you do GameRegistry.xyz(); at one time and the line below you do net.minecraftforge.fml.common.registry.GameRegistry.abc() ? Maybe your inports are broken? Otherwise after a quick testing it works for me... Should I use one over the other? What's the difference?
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.