How would I set the potion type when adding it to a players inventory. Ive tried Code:java player.getInventory().addItem(Material.Potion(PotionEffectType.HEAL)) ; because that was all I could find on various google searches and it did not work. Any help would be greatly appreciated. Thanks.
zakarls Code:java p.getInventory().addItem(new ItemStack(Material.POTION, 1, (short) 8193)); You can get the potions ID's from this page: ID's Page Scroll down to the potions ID's You need the second number in the potions ID. For example. ID : 373:8193 - Regeneration Potion (0:45) You want the number thats bolded. You would put that number where it is above on the code.
Code:java e.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.CONFUSION, 200, 1)); Sorry if I am answering incorrectly but this is how I add potion effects to a player.