Posted July 29, 201510 yr So I'm trying to create a crafting recipe, in which you put cobblestone and a pickaxe into a crafting menu to get gravel, and the cobblestone is consumed and the pickaxe takes one durability damage. I'm just getting into modding so I search through the internet for help but I can only find articles about taking crafting damage for custom items. So my question is; is it possible to do such a thing with vanilla tools, and if so, how? Help is much appreciated!!! Thanks!
July 29, 201510 yr Author Okay, so I think I'm in the right place! I poked around in the GameRegistry around IRecipe and I think I'm on track, but still a bit lost! Here's what I got set up: public class GravelCrafting implements IRecipe{ @Override public boolean matches(InventoryCrafting p_77569_1_, World worldIn) { // TODO Auto-generated method stub return false; } @Override public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) { // TODO Auto-generated method stub return null; } @Override public int getRecipeSize() { // TODO Auto-generated method stub return 0; } @Override public ItemStack getRecipeOutput() { // TODO Auto-generated method stub return null; } @Override public ItemStack[] getRemainingItems(InventoryCrafting p_179532_1_) { // TODO Auto-generated method stub return null; } } So I apologize greatly for asking silly questions, but if I'm making sense of this right, I need to access the array generated by getRemainingItems, so how would I do that?
July 30, 201510 yr This is easier if you extend an existing recipe class like ShapedRecipes or ShapelessRecipes (or the equivalent ore recipe classes), this way you only need to override getRemainingItems to return the appropriate array and don't need to re-implement the matches method. I have an example of this here. 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.
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.