Jump to content

Crafting: how to get an item back?


StrohiZock

Recommended Posts

First of all: I am from Germany, so there may be grammar mistakes in my post. Please excuse me.

 

Hey, I wanted to create a new crafting-recipe.

It is really easy: By putting a knife (an item of my mod) and a potato in crafting field, you get 4 potato wedges (another item of my mod). But after klicking on the stack, the knife and the potato disappear. I do not want this, because it is very expensive if you need 1 knife for 4 potato wedges.

Instead of losing the knife, I just want to get it back or stay in the crafting-field. Just like the crafting-recipe for a cake, where you get three buckets back.

After searching @ source and google, I was not able to find how they made it. Does anyone know how to get an item back after crafting?

Link to comment
Share on other sites

Where you set your item instance: itemKnife = new ItemKnife(6000).setUnlocalizedName("knife") you add .setContainerItem(itemKnife) so it becomes itemKnife = new ItemKnife(6000).setContainerItem(itemKnife).setUnlocalizedName("knife").

Thanks...!

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.