Interface ThrownPotion

All Superinterfaces:
CommandSender, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, Projectile, ServerOperator, ThrowableProjectile
All Known Subinterfaces:
LingeringPotion, SplashPotion

public interface ThrownPotion extends ThrowableProjectile
Represents a thrown potion bottle
  • Method Details

    • getEffects

      @NotNull Collection<PotionEffect> getEffects()
      Returns the effects that are applied by this potion.
      The potion effects
    • getItem

      @NotNull ItemStack getItem()
      Returns a copy of the ItemStack for this thrown potion.

      Altering this copy will not alter the thrown potion directly. If you want to alter the thrown potion, you must use the setItemStack method.

      Specified by:
      getItem in interface ThrowableProjectile
      A copy of the ItemStack for this thrown potion.
    • setItem

      void setItem(@NotNull ItemStack item)
      Set the ItemStack for this thrown potion.

      The ItemStack must be of type Material.SPLASH_POTION or Material.LINGERING_POTION, otherwise an exception is thrown.

      Specified by:
      setItem in interface ThrowableProjectile
      item - New ItemStack