接口 Arrow

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

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

    • setBasePotionData

      @Deprecated(since="1.20.6") void setBasePotionData(@Nullable @Nullable PotionData data)
      已过时。
      升级/延长的药水现在是独立的 PotionType,请使用 setBasePotionType(org.bukkit.potion.PotionType) 替代.
      设置底层药水数据.

      原文:Sets the underlying potion data

      参数:
      data - 要设置的基础药水状态的 PotionData
    • getBasePotionData

      @Nullable @Deprecated(since="1.20.6") @Nullable PotionData getBasePotionData()
      已过时。
      升级/延长的药水现在是独立的 PotionType,请使用 getBasePotionType() 替代.
      返回关于基础药水的药水数据.

      原文:Returns the potion data about the base potion

      返回:
      PotionData 对象
    • setBasePotionType

      void setBasePotionType(@Nullable @Nullable PotionType type)
      设置底层药水类型.

      原文:Sets the underlying potion type

      参数:
      type - 要设置的基础药水状态的 PotionType
    • getBasePotionType

      @Nullable @Nullable PotionType getBasePotionType()
      返回关于基础药水的药水类型.

      原文:Returns the potion type about the base potion

      返回:
      PotionType 对象
    • getColor

      获取此箭矢的颜色.

      原文:Gets the color of this arrow.

      返回:
      箭矢的 Color,如果未设置颜色则为 null
    • setColor

      void setColor(@Nullable @Nullable Color color)
      设置此箭矢的颜色. 将作为其粒子的着色应用.

      原文:Sets the color of this arrow. Will be applied as a tint to its particles.

      参数:
      color - 箭矢颜色,null 表示清除颜色
    • hasCustomEffects

      boolean hasCustomEffects()
      检查是否存在自定义药水效果.

      原文:Checks for the presence of custom potion effects.

      返回:
      如果应用了自定义药水效果则为 true
    • getCustomEffects

      @NotNull @NotNull List<PotionEffect> getCustomEffects()
      获取应用于此箭矢的所有自定义药水效果的不可变列表.

      插件应在调用此方法前检查 hasCustomEffects() 是否返回 true.

      原文:Gets an immutable list containing all custom potion effects applied to this arrow.

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

      返回:
      自定义药水效果的不可变列表
    • addCustomEffect

      boolean addCustomEffect(@NotNull @NotNull PotionEffect effect, boolean overwrite)
      添加自定义药水效果到此箭矢.

      原文:Adds a custom potion effect to this arrow.

      参数:
      effect - 要添加的药水效果
      overwrite - 如果为 true,则覆盖同类型的现有效果
      返回:
      如果因此次调用添加了效果则为 true
    • removeCustomEffect

      boolean removeCustomEffect(@NotNull @NotNull PotionEffectType type)
      从此箭矢移除自定义药水效果.

      原文:Removes a custom potion effect from this arrow.

      参数:
      type - 要移除的药水效果类型
      返回:
      如果因此次调用移除了效果则为 true
      抛出:
      IllegalArgumentException - 如果此操作会使箭矢处于无自定义效果且药水类型为 UNCRAFTABLE 的状态
    • hasCustomEffect

      boolean hasCustomEffect(@Nullable @Nullable PotionEffectType type)
      检查此箭矢上是否存在特定的自定义药水效果类型.

      原文:Checks for a specific custom potion effect type on this arrow.

      参数:
      type - 要检查的药水效果类型
      返回:
      如果药水有此效果则为 true
    • clearCustomEffects

      void clearCustomEffects()
      移除此箭矢的所有自定义药水效果.

      原文:Removes all custom potion effects from this arrow.

      抛出:
      IllegalArgumentException - 如果此操作会使箭矢处于无自定义效果且药水类型为 UNCRAFTABLE 的状态