Potion

Discussion in 'Plugin Development' started by Batman500, Jul 2, 2014.

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

    Batman500

    How can I generate a potion by id for example: I have a potion with the id "373:16428", how could I generate a potion from that information?

    I already tried:
    Code:java
    1. int id = 373;
    2. int amount = 1;
    3. byte data = 16428;
    4. ItemStack i = new ItemStack(id,amount,data);
     
  2. Offline

    mythbusterma

  3. Offline

    Batman500

    I already tried to create, but when I try to put in "itemstack" will it not go

    Edited:
    I'll try now:
    "toItemStack"

    mythbusterma
    Thank you
    I used:
    Code:java
    1.  
    2. Potion p = Potion.fromDamage(16428)
    3. ItemStack i = new ItemStack(p.toItemStack(1));


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
    mythbusterma likes this.
Thread Status:
Not open for further replies.

Share This Page