Jump to content

[SOLVED] Can Not Use Item Again Once Its Been Damaged


FloatingGrapefruit

Recommended Posts

Hello everyone. I have an item that I want to be damaged in the crafting grid, and it does take damage. The problem, however, is that once it takes damage, I can not use it again. This is what happens:

width=640 height=359http://s2.postimg.org/5e66nkn6h/2013_04_27_17_02_28.png[/img]

width=640 height=359http://s21.postimg.org/ll8kct5ef/2013_04_27_17_02_38.png[/img]

Here is my crafting recipie:

ItemStack(baconCutter.setContainerItem(baconCutter));
GameRegistry.addShapelessRecipe(new ItemStack(baconRaw, 4),
            new Object[] {
        Item.porkRaw, new ItemStack(baconCutter, 1, -1)
});

 

and my baconCutter class:

package mods.crystalia.common;

import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;



public class BaconCutter extends Item{

public BaconCutter(int id) {
	super(id);
	maxStackSize = 1;
	setMaxDamage(10);
	setCreativeTab(CreativeTabs.tabTools);
}
 @Override 
  public boolean doesContainerItemLeaveCraftingGrid(ItemStack itemstack) {
   
       return false;
       
      }
  
  
   @Override
   public ItemStack getContainerItemStack(ItemStack itemStack) {
   
        itemStack.setItemDamage(itemStack.getItemDamage() + 1);
        
          return itemStack;
         
       }
}

 

I would love any help, as this is fustrating.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.