Jump to content

[1.6.4]Item that doesn't break when it has 0 durability


Gugu42

Recommended Posts

Hello !

I'm trying to make an Item ( a "gun" wich uses it's own durability to contain the ammo). The problem is that I don't want it to be destroyed once it's empty ( Durability 0 )

 

How can I stop it from breaking ?

 

I tried this in my item :

 

public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World,
		EntityPlayer par3EntityPlayer) {

	if(par1ItemStack.getItemDamage() > 0){ 
		if(!par2World.isRemote){
			//random code
		}
	}

	return par1ItemStack;
}

 

But it just don't do the code specified

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now


×
×
  • Create New...

Important Information

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