Interface ThrownPotion

All Superinterfaces:
Audience, CommandSender, Entity, HoverEventSource<HoverEvent.ShowEntity>, Metadatable, Nameable, Permissible, PersistentDataHolder, Pointered, Projectile, ServerOperator, Sound.Emitter, ThrowableProjectile
All Known Subinterfaces:
LingeringPotion, SplashPotion

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

    • getEffects

      Returns the effects that are applied by this potion.
      Returns:
      The potion effects
    • 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
      Returns:
      A copy of the ItemStack for this thrown potion.
    • setItem

      void setItem(@NotNull @NotNull ItemStack item)
      Set the ItemStack for this thrown potion.
      Specified by:
      setItem in interface ThrowableProjectile
      Parameters:
      item - New ItemStack
    • getPotionMeta

      @NotNull PotionMeta getPotionMeta()
      Gets a copy of the PotionMeta for this thrown potion. This includes what effects will be applied by this potion.
      Returns:
      potion meta
    • setPotionMeta

      void setPotionMeta(@NotNull PotionMeta meta)
      Sets the PotionMeta of this thrown potion. This will modify the effects applied by this potion.

      Note that the type of getItem() is irrelevant

      Parameters:
      meta - potion meta
    • splash

      void splash()
      Splashes the potion at its current location.