Splash Potions

Discussion in 'Spigot Plugin Development' started by DidactCraft, May 31, 2015.

  1. Ok, I'm trying to create a instant health pot, tier 2 and its a splash pot. But I'm not sure how to do it.

    Please if you can, leave some code below with the itemstack :) This is my current code >
    Inventory pot = Bukkit.getServer().createInventory(null, 27, "§c§lPot Selector");
    Potion potion = new Potion(PotionType.INSTANT_HEAL);
    ItemStack stack = new ItemStack(Material.POTION, 1, (short)2);
    potion.apply(stack);
     
  2. Code (Text):
    ItemStack pot = new ItemStack(Material.POTION, 1, (short) 16421);
     
  3. Create a item with data and id for poit
    Code (Text):
      public ItemStack createPotion(int amount, int data)
      {
        ItemStack item = new ItemStack(Material.POTION, amount, (short)data);
        return item;
      }
    And to put it in inventory use
    Code (Text):
    inv.addItem(createPotion(amountPotion, potionDATAID));