Jump to content

MC1.10+ Return multiple items from recipe


winnetrie

Recommended Posts

You can try the "PlayerEvent.ItemCraftedEvent" and if the items "crafted" is your milk bottle give 2 more (3 total)

 

I'm not sure if the the player.inventory.addItem also handles a full inventory (aka throws excess on the ground) or you need to handle that as well.

 

EDIT:

 

I'm not sure if the exact command method is "addItem" just a rough guess

Link to comment
Share on other sites

Override

IRecipe#getRemainingItems

for full control of the items left by the recipe. The items you return from this will be added to the player's inventory if there's no room in the crafting grid for them or dropped on the ground if there's no room in the player's inventory.

 

I'm not sure if the the player.inventory.addItem also handles a full inventory (aka throws excess on the ground) or you need to handle that as well.

 

It doesn't, but

ItemHandlerHelper.giveItemToPlayer

does.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

Well i solved my problem with another way.

I made a brewing recipe with a milkbucket as ingredient and empty bottles as input.

BUT, apparently you cannot use stackable items as input for brewing recipe, so....i made my own empty bottles.

 

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.