Posted July 7, 201411 yr Hey Guys, I want to make an Item which loses durability while crafting like in EE3 or IC2, i've created the Item and a extendable Item just for the Methods. I think i need the hasContainerItem method but i'm not sure atm. public class toolHammer extends Item{ public toolHammer(){ super(); this.setMaxStackSize(1); this.setNoRepair(); this.setCreativeTab(CreativeTabs.tabMisc); } @Override public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemStack){ return false; } @Override public boolean getShareTag(){ return true; } @Override public ItemStack getContainerItem(ItemStack itemStack){ ItemStack copiedStack = itemStack.copy(); copiedStack.setItemDamage(copiedStack.getItemDamage() + 1); copiedStack.stackSize = 1; return copiedStack; } } public class toolCrystalHammer extends toolHammer{ private String text = Main.MODID + ":toolCrystalHammer"; public toolCrystalHammer(){ this.setMaxDamage(128); this.setUnlocalizedName("toolCrystalHammer"); this.setTextureName(text); } } hope u can help me
July 7, 201411 yr In item class: public boolean doesContainerItemLeaveCraftingGrid(ItemStack iStack){ return false; } public boolean hasContainerItem(){ return true; } public ItemStack getContainerItemStack(ItemStack iStack){ iStack.setItemDamage(iStack.getItemDamage() + 1); return iStack; } In Recipe: GameRegistry.addShapelessRecipe(new ItemStack(Your_Item, 1), new Object[] {new ItemStack(Your_Item_To_Damage, 1, OreDictionary.WILDCARD_VALUE)});
July 7, 201411 yr Author In item class: public boolean doesContainerItemLeaveCraftingGrid(ItemStack iStack){ return false; } public boolean hasContainerItem(){ return true; } public ItemStack getContainerItemStack(ItemStack iStack){ iStack.setItemDamage(iStack.getItemDamage() + 1); return iStack; } In Recipe: GameRegistry.addShapelessRecipe(new ItemStack(Your_Item, 1), new Object[] {new ItemStack(Your_Item_To_Damage, 1, OreDictionary.WILDCARD_VALUE)}); why the recipe ?
July 7, 201411 yr Author okay diesieben07, so i've added the hasContainerItem method. I think now i need a crafting handler or ?
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.