Zeurkous Posted June 29, 2016 Posted June 29, 2016 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. Quote
Zeurkous Posted June 29, 2016 Author Posted June 29, 2016 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? Quote
Zeurkous Posted June 29, 2016 Author Posted June 29, 2016 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 Quote
Zeurkous Posted June 29, 2016 Author Posted June 29, 2016 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. Quote
Recommended Posts
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.