Interface Arrow

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

public interface Arrow extends AbstractArrow
  • Method Details

    • setBasePotionData

      @Deprecated void setBasePotionData(@NotNull @NotNull PotionData data)
      Deprecated.
      Upgraded / extended potions are now their own PotionType use setBasePotionType(org.bukkit.potion.PotionType) instead.
      Sets the underlying potion data
      Parameters:
      data - PotionData to set the base potion state to
    • getBasePotionData

      Deprecated.
      Upgraded / extended potions are now their own PotionType use getBasePotionType() instead.
      Returns the potion data about the base potion
      Returns:
      a PotionData object
    • setBasePotionType

      void setBasePotionType(@NotNull @NotNull PotionType type)
      Sets the underlying potion type
      Parameters:
      type - PotionType to set the base potion state to
    • getBasePotionType

      @NotNull @NotNull PotionType getBasePotionType()
      Returns the potion type about the base potion
      Returns:
      a PotionType object
    • getColor

      Gets the color of this arrow.
      Returns:
      arrow Color or null if not color is set
    • setColor

      void setColor(@Nullable @Nullable Color color)
      Sets the color of this arrow. Will be applied as a tint to its particles.
      Parameters:
      color - arrow color, null to clear the color
    • hasCustomEffects

      boolean hasCustomEffects()
      Checks for the presence of custom potion effects.
      Returns:
      true if custom potion effects are applied
    • getCustomEffects

      @NotNull @NotNull List<PotionEffect> getCustomEffects()
      Gets an immutable list containing all custom potion effects applied to this arrow.

      Plugins should check that hasCustomEffects() returns true before calling this method.

      Returns:
      the immutable list of custom potion effects
    • addCustomEffect

      boolean addCustomEffect(@NotNull @NotNull PotionEffect effect, boolean overwrite)
      Adds a custom potion effect to this arrow.
      Parameters:
      effect - the potion effect to add
      overwrite - true if any existing effect of the same type should be overwritten
      Returns:
      true if the effect was added as a result of this call
    • removeCustomEffect

      boolean removeCustomEffect(@NotNull @NotNull PotionEffectType type)
      Removes a custom potion effect from this arrow.
      Parameters:
      type - the potion effect type to remove
      Returns:
      true if the effect was removed as a result of this call
      Throws:
      IllegalArgumentException - if this operation would leave the Arrow in a state with no Custom Effects and PotionType.UNCRAFTABLE
    • hasCustomEffect

      boolean hasCustomEffect(@Nullable @Nullable PotionEffectType type)
      Checks for a specific custom potion effect type on this arrow.
      Parameters:
      type - the potion effect type to check for
      Returns:
      true if the potion has this effect
    • clearCustomEffects

      void clearCustomEffects()
      Removes all custom potion effects from this arrow.
      Throws:
      IllegalArgumentException - if this operation would leave the Arrow in a state with no Custom Effects and PotionType.UNCRAFTABLE