Jump to content

[solved][1.6.2] item damaging while crafting


sefodopos

Recommended Posts

Could somebody please tell me what and how to make my custom created item take damage when you use it in the crafting recipe instead of destroying it. I know I have been able to do it a long time ago but I deleted that and now I can't find out how to do that. So if anyone could link me to a page that describes that, that would be nice.

Link to comment
Share on other sites

How exactly do you override something like that i have tried but it doesn't do anything.

package sefodopo.mine;

import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import sefodopo.mine.Mine;

public class GrindItem extends Item {

public GrindItem(int par1) {
	super(par1);
}


@Override
public ItemStack getContainerItemStack(ItemStack par1ItemStack){

	return new ItemStack(Mine.grindItem);
}


}

It just won't register and give me a item after i craft with it.

And also if somebody could tell me how to remove a crafting recipe from vanilla that would be appreciated.

Link to comment
Share on other sites

Well... Of course that won't work. You returning A NEW item stack.

 

Try something like:

        @Override
public ItemStack getContainerItemStack(ItemStack par1ItemStack){
	par1ItemStack.damageItem(1, Minecraft.getMinecraft().thePlayer);

	return par1ItemStack;
}

 

I am not saying that will 100% work, but hey. Give it a try.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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.

Announcements



×
×
  • Create New...

Important Information

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