Posted August 27, 20169 yr Hello, I'd like to find out how to specify a potion in a recipe (i.e. make a Shaped Recipe use a Healing I potion and a few other things, but no other potion is used.). I do know how to make & register normal shaped & shapeless recipes. If I'm asking a whole bunch of questions, please don't get angry. I'm trying to learn.
August 27, 20169 yr Instead of using an Item or a Block use an ItemStack and i believe it is metadata, if not it is nbt. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 27, 20169 yr Instead of using an Item or a Block use an ItemStack and i believe it is metadata, if not it is nbt. Potions use nbt to differentiate between types. Unfortunately, I don't think vanilla recipes check an ItemStack's NBT data when checking if a recipe is valid, so you're probably going to have to make your own IRecipe class. (Although it shouldn't be that hard. Pretty much exactly the same as ShapedRecipe, just override ShapedRecipe#checkMatch to check for NBT data as well). Minecraft nicely provides PotionUtils, which has a method called getPotionFromItem that you can use to check a given ItemStack's potion type against the one you desire.
August 27, 20169 yr Author I found how to use specific potions in recipes. I used TheMasterGabriel's method, by using PotionUtils. Example code for future googlers: new PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.STRONG_HEALING)); If I'm asking a whole bunch of questions, please don't get angry. I'm trying to learn.
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.