Posted November 5, 20168 yr Is it posseble to return multiple non-stackable items from a recipe? I want to get 3 milk bottles out of 1 milk bucket. They have to be non-stackable! Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
November 5, 20168 yr 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 Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
November 5, 20168 yr 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.
November 5, 20168 yr Author 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. Try out my new Modpack for MC 1.15.2 https://www.curseforge.com/minecraft/modpacks/terran-civilization
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.