Posted June 29, 20169 yr If I would start with a String input (the name of a vanilla potion), how would I end up with an ItemStack of that potion? The input ofcourse is something the player gives and thus can be any potion that exists. Anyone has any idea? I tried this Potion potion = Potion.getPotionFromResourceLocation(potionString); but i can't make an ItemStack with that.
June 29, 20169 yr Author That did indeed work. Thanks. But what I get now is a Waterbottle with an effect. What input would I need to send in order to get an actual vanilla potion?
June 29, 20169 yr Author Okay, now this PotionUtils.appendEffects(new ItemStack(Items.POTIONITEM), Collections.singleton(potion)); gives an error, wrong argument for method. So how do I make an ItemStack from the PotionType? PotionType potion = PotionType.getPotionTypeForName(potionString); ItemStack itemstack = new ItemStack(potion,1); doesn't work either
June 29, 20169 yr Author Oh great thanks, this succesfully works on normal potions. But how would I get a splash or lingering potion? Cause PotionTypes doesn't specify that.
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.