Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

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

Posted

make it like this:

 

public ItemStack getContainerItemStack(ItemStack par1)

{

      par1.setItemDamage(par1.getItemDamage()+1);

      return par1.copy();

}

 

i hope that helps^^"

Posted

I couldn't get any of your ways to work i don't know if i have to set a container item or what but i can get it to work if i use a crafting handler that i found on a different website for a older version of minecraft that still works thanks for trying though.

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.