Hi, i got a problem. Maybe first the code:
public class ItemBandage extends Item {
public ItemBandage(int par1) {
super(par1); //par1 is ID
setCreativeTab(CreativeTabs.tabMisc);
}
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
if (hamrInjurys.brokenFootBoolean==true){
--par1ItemStack.stackSize;
hamrInjurys.brokenFootBoolean = false;
}
return par1ItemStack;
}
}
brokenFootBoolean gets true once a certain potion of mine is activated. That is working.
So when rightclicked, --par1ItemStack.stackSize makes sure it gets removed from my inventory (it cant be stacked) And then setting brokenFootBoolean is for something else.
So then, the spot where the bandage was is empty. But if i rightclick again once or twice, the item returns. You could see that as eating your food, right clicking with your hand in the air, and getting it back. How can i fix that?
Edit, main class (RS_HAMR) :
In class itself:
public static Item bandage;
In @init :
bandage = new ItemBandage(7000).setUnlocalizedName("bandage").setMaxStackSize(1);
LanguageRegistry.addName(bandage, "Bandage");
EDIT 2: Seems you only get it back when you rightclick a block, not the air.