Posted April 21, 20205 yr Hi, I'm using a method to create a brewing recipe, and it is asking for Ingredient, all I can see from the Ingredient class is to get an item, however, I need to specify a paticular potion, how would I do this?
April 21, 20205 yr You can use PotionUtils.addPotionToItemStack, then use the resulting stack as an ingredient. I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.
April 21, 20205 yr Author 2 minutes ago, imacatlolol said: You can use PotionUtils.addPotionToItemStack, then use the resulting stack as an ingredient. Okay.... So I have BrewingRecipeRegistry.addRecipe(Ingredient.fromStacks(PotionUtils.addPotionToItemStack(here, Potions.AWKWARD))); But I'm not sure what to put for 'here' as it wants an ItemStack..
April 21, 20205 yr Just now, modders2 said: But I'm not sure what to put for 'here' as it wants an ItemStack.. You would create a new item stack of whatever type of potion you're trying to make. Items.POTION, Items.SPLASH_POTION, and Items.LINGERING_POTION are the vanilla ones. You could either do new ItemStack(item) or item#getDefaultInstance() to get a stack of any item. I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.
April 21, 20205 yr Author 15 minutes ago, imacatlolol said: You would create a new item stack of whatever type of potion you're trying to make. Items.POTION, Items.SPLASH_POTION, and Items.LINGERING_POTION are the vanilla ones. You could either do new ItemStack(item) or item#getDefaultInstance() to get a stack of any item. Okay, so I've done this and I have the following: BrewingRecipeRegistry.addRecipe(Ingredient.fromStacks(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.AWKWARD)), Ingredient.fromItems(ItemList.PEPPERS.get()), PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), PotionList.MORE_HEALTH_POTION.get())); Only problem with this, is that I can put one in, and it brews fine, however, putting more than one in will just keep brewing, it is accepting all potions, and overriding them if they aren't the output one
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.