public static ItemStack createPotion(
      PotionType type, int level, boolean splash, boolean extended, int amount) {
    Potion pot = new Potion(type, level);
    pot.setSplash(splash);
    if (extended) pot.setHasExtendedDuration(true);

    return pot.toItemStack(amount);
  }
Пример #2
0
  private ItemStack[] getItemss() {
    Potion pot1 = new Potion(PotionType.INSTANT_DAMAGE, 2);
    pot1.setSplash(true);
    ItemStack itempot1 = pot1.toItemStack(1);

    Potion pot2 = new Potion(PotionType.POISON, 2);
    pot2.setSplash(true);
    ItemStack itempot2 = pot2.toItemStack(1);

    Potion pot3 = new Potion(PotionType.WEAKNESS, 2);
    pot3.setSplash(true);
    pot3.setHasExtendedDuration(true);
    ItemStack itempot3 = pot3.toItemStack(1);

    ItemStack[] is = {itempot1, itempot2, itempot3};
    return is;
  }
Пример #3
0
 public Potion extend() {
   setHasExtendedDuration(true);
   return this;
 }