Getting a Splash Potion with a Custom effect

Discussion in 'Spigot Plugin Development' started by bxb45678, Jun 2, 2017.

  1. I can't seem to get a splash potion from any Custom effect.

    public void addPotionEffect(PotionEffectType effect, int duration, int lvl){
    PotionMeta pm = (PotionMeta) i.getItemMeta();
    pm.addCustomEffect(new PotionEffect(effect, duration, lvl), true);
    i.setItemMeta(pm);
    }

    and in another class

    ClassItem.addPotion(PotionEffectType.WITHER, 100,2, 64,(short)16384);


    I'm dealing with the item stack elsewhere in the code. I'm getting a drinkable wither potion, not a splash potion. I'm using material.POTION in my itemstack, however if I use SPLASH_POTION the potion has a missing texture. Anyone know what I'm doing wrong?