接口 Arrow

所有超级接口:
AbstractArrow, CommandSender, Entity, Metadatable, Nameable, Permissible, PersistentDataHolder, Projectile, ServerOperator
所有已知子接口:
TippedArrow

public interface Arrow extends AbstractArrow
表示一只箭矢.
  • 方法详细资料

    • setBasePotionData

      void setBasePotionData(@NotNull @NotNull PotionData data)
      Sets the underlying potion data
      参数:
      data - PotionData to set the base potion state to
    • getBasePotionData

      @NotNull @NotNull PotionData getBasePotionData()
      Returns the potion data about the base potion
      返回:
      a PotionData object
    • getColor

      Gets the color of this arrow.
      返回:
      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.
      参数:
      color - arrow color, null to clear the color
    • hasCustomEffects

      boolean hasCustomEffects()
      Checks for the presence of custom potion effects.
      返回:
      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.

      返回:
      the immutable list of custom potion effects
    • addCustomEffect

      boolean addCustomEffect(@NotNull @NotNull PotionEffect effect, boolean overwrite)
      Adds a custom potion effect to this arrow.
      参数:
      effect - the potion effect to add
      overwrite - true if any existing effect of the same type should be overwritten
      返回:
      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.
      参数:
      type - the potion effect type to remove
      返回:
      true if the an effect was removed as a result of this call
      抛出:
      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.
      参数:
      type - the potion effect type to check for
      返回:
      true if the potion has this effect
    • clearCustomEffects

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