Posted September 3, 20196 yr I'm trying to change the recipe for wooden planks in 1.12.2. Whenever I need to change the recipe for something, I remove the vanilla one and then add my own JSON file in assets. However, I'm having trouble removing the recipe for things with metadata. How do I remove the recipes for wood planks, for example? Here's the code I've been using: I am unable to use replaceTheseRecipes.add(minecraft:oak_planks), and replaceTheseRecipes.add(minecraft:planks) doesn't work either. Any help is appreciated! public static void removeRecipes() { ForgeRegistry<IRecipe> recipeRegistry = (ForgeRegistry<IRecipe>)ForgeRegistries.RECIPES; ArrayList<IRecipe> recipes = Lists.newArrayList(recipeRegistry.getValuesCollection()); ArrayList<String> replaceTheseRecipes = Lists.newArrayList(); replaceTheseRecipes.add("minecraft:stone_sword"); replaceTheseRecipes.add("minecraft:stone_pickaxe"); replaceTheseRecipes.add("minecraft:stone_axe"); replaceTheseRecipes.add("minecraft:stone_shovel"); replaceTheseRecipes.add("minecraft:stone_hoe"); replaceTheseRecipes.add("minecraft:furnace"); replaceTheseRecipes.add("minecraft:chest"); replaceTheseRecipes.add("minecraft:stick"); for (IRecipe r : recipes) { ItemStack output = r.getRecipeOutput(); for (String replaceThisItem : replaceTheseRecipes) { Item itemToReplace = Item.getByNameOrId(replaceThisItem); if (output.getItem() == itemToReplace) { System.out.println("The r.getRegistry name is: " + r.getRegistryName() + ". The Item.getRegistryName was: " + itemToReplace.getRegistryName()); if (r.getRegistryName().equals(itemToReplace.getRegistryName())) { System.out.println("We're now removing the recipe for: " + r.getRegistryName()); recipeRegistry.remove(r.getRegistryName()); break; } else { System.out.println("We DIDN'T remove a suspiciously similar item: " + r.getRegistryName()); } } } } } Edited September 3, 20196 yr by probe
September 3, 20196 yr 1) I don't know why you're comparing strings instead of Items. 2) I don't know why you're not using data packs for this 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.
September 3, 20196 yr Author 1 minute ago, Draco18s said: 1) I don't know why you're comparing strings instead of Items. 2) I don't know why you're not using data packs for this Thanks for the help? (Sarcasm) The strings are temporary. I'm new to this whole thing and I'm still trying to figure everything out.
September 3, 20196 yr Well. Why aren't you using data packs? You create a recipe json in the minecraft asset directory and it will override the vanilla recipe. 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.
September 3, 20196 yr Author 8 minutes ago, Draco18s said: Well. Why aren't you using data packs? You create a recipe json in the minecraft asset directory and it will override the vanilla recipe. I tried simply putting a recipe JSON in the assets package but it wouldn't change anything ingame unless I removed the vanilla recipe from the registry as well.
September 3, 20196 yr You have to put it in the minecraft folder of your assets. You can't just put it anywhere. Edited September 3, 20196 yr by Draco18s 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.
September 5, 20196 yr Author What about this is causing the Acacia Log -> Acacia Planks Recipe not to be replaced?
September 5, 20196 yr Author 6 minutes ago, diesieben07 said: Which part of this did you not understand? Pretty much the whole thing. I'm sorry that I sound so thick but I honestly can't figure this out.
September 5, 20196 yr Author 3 15 minutes ago, diesieben07 said: The recipe file must be in the exact same location that it has in vanilla minecraft. Which is assets/minecraft/recipes. That IS assets/minecraft/recipes.
September 5, 20196 yr Author 10 minutes ago, diesieben07 said: That should work. Is there anything in the log? If not, post a working Git repository of your mod. Nothing in the log. Not sure if relevant but Item.getByNameOrId("minecraft:acacia_planks")); returns null. Is this like a weird quirk of 1.12.2 or something? Last time I played minecraft was when number IDs were the only kind of IDs ._. Gotta head to class but I'll see about a repository when I'm back.
September 5, 20196 yr 31 minutes ago, probe said: Is this like a weird quirk of 1.12.2 or something? Last time I played minecraft was when number IDs were the only kind of IDs ._. You're looking for "minecraft:planks" with a metadata value of 4. 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.
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.