Jump to content

{1.8} Weird Issue With Crafting


Recommended Posts

Ok, please describe exactly what you want to happen, I am having difficulty understanding what you want.



The hammer is used in crafting. It takes durability when you use it while crafting. That works.

If you take 2 tools in vanilla and put the together, they both combine.

If you take 2 hammers and put them together, they just keep making more.

This is what I mean: https://gyazo.com/9f72ca4eac19b6480703d6334948fbff

It just lets me make more.

I was wondering how do I not make it repairable like that?

Link to comment
Share on other sites

I see. So you want it to have a container item in one recipe but not in the other. You will have to make a custom IRecipe then and override getRemainingItems in there. The easiest would be to extend ShapedOreRecipe and just override that one method.


I override getRemainingItems, but what do I put in there?

I have:

public ItemStack[] getRemainingItems(InventoryCrafting p_179532_1_) {
	return null;

I'm still kinda new to programming so please excuse me.

Link to comment
Share on other sites

Look at the default implementation (e.g. ForgeHooks.defaultRecipeGetRemainingItems) and modify it for your needs.

I found it. But I never worked with inventory things before.

    public static ItemStack[] defaultRecipeGetRemainingItems(InventoryCrafting inv)
        ItemStack[] ret = new ItemStack[inv.getSizeInventory()];
        for (int i = 0; i < ret.length; i++)
            ret[i] = getContainerItem(inv.getStackInSlot(i));
        return ret;


That is what I found.

The only part I don't understand is what do I need to change?

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.

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.


  • Create New...

Important Information

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