Question About Potions

Discussion in 'Plugin Development' started by redytedy, Jul 7, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    redytedy

    This is the code I am using to give 2 regeneration potions:
    Code:
    ItemStack tool8 = new ItemStack(Material.POTION, 2);
    Potion pot2 = new Potion(2); 
    pot2.setType(PotionType.REGEN);
    pot2.setSplash(true);
     
    pot2.apply(tool8);
    
    What I am wondering is
    a) what does the parameters "2" mean after new potion
    b) How would I make it regeneration II
     
  2. Offline

    SandKastle

  3. Offline

    redytedy

    I don't understand how to use the regen 2 thing...

    bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  4. Offline

    chris4315

    Using http://www.minecraftwiki.net/wiki/Splash_Potions I figured out that this is how you can add a Regen II splash potion to a Player's inventory.

    Code:java
    1.  
    2. Inventory inv = player.getInventory();
    3. ItemStack potion = new ItemStack(373, 1, (short) 16417);
    4. inv.addItem(potion);
    5.  


    BTW the params in new ItemStack(): the first means the item ID, the second is the amount, and the third is additional data values. G'nite!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  5. Offline

    redytedy

    That didn't work :/

    I got just regular regen.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
  6. Offline

    nisovin

    Code:
    pot2.setLevel(2);
     
Thread Status:
Not open for further replies.

Share This Page