接口 BlocksAttacksComponent

所有超级接口:
ConfigurationSerializable

@Experimental public interface BlocksAttacksComponent extends ConfigurationSerializable
代表一个可以将任何物品变成类似盾牌的物品以格挡攻击伤害的组件.

原文: Represents a component which can turn any item into a shield-like item which blocks attack damage.

  • 方法详细资料

    • getBlockDelaySeconds

      float getBlockDelaySeconds()
      获取装备此物品后, 在开始格挡攻击前的延迟时间.

      原文: Gets the delay on equip before this item will block attacks.

      返回:
      延迟时间 (单位: 秒)
    • setBlockDelaySeconds

      void setBlockDelaySeconds(float seconds)
      设置装备此物品后, 在开始格挡攻击前的延迟时间.

      原文: Sets the delay on equip before this item will block attacks.

      参数:
      seconds - 要设置的延迟时间 (单位: 秒)
    • getDisableCooldownScale

      float getDisableCooldownScale()
      获取当被一个能造成"缴械"效果的攻击击中时, 应用于物品冷却时间的倍增系数.

      原文: Gets the multiplier applied to the item cooldown when attacked by a disabling attack.

      返回:
      倍增系数
    • setDisableCooldownScale

      void setDisableCooldownScale(float scale)
      设置当被一个能造成"缴械"效果的攻击击中时, 应用于物品冷却时间的倍增系数.

      原文: Sets the multiplier applied to the item cooldown when attacked by a disabling attack.

      参数:
      scale - 要设置的倍增系数. 必须为0或正整数
    • getDamageReductions

      获取适用于此物品的 伤害减免 列表.

      原文: Get the list of DamageReductions that apply to this item.

      返回:
      所有伤害减免. 返回列表的可变性无法保证, 但其内容是可变的, 可以更改它们的值
    • setDamageReductions

      void setDamageReductions(@NotNull @NotNull List<BlocksAttacksComponent.DamageReduction> reductions)
      设置要应用于此物品的 伤害减免 列表. 这将移除任何现有的伤害减免.

      原文: Set the list of DamageReductions to apply to this item. This will remove any existing damage reductions.

      参数:
      reductions - 要设置的伤害减免列表
    • addDamageReduction

      @NotNull @NotNull BlocksAttacksComponent.DamageReduction addDamageReduction(@NotNull @NotNull DamageType type, float base, float factor, float horizontalBlockingAngle)
      向此组件添加一个新的伤害减免, 该减免针对特定类型的攻击.

      原文: Add a new damage reduction to this component, which blocks specific types of attacks.

      参数:
      type - 攻击类型
      base - 要格挡的固定伤害值
      factor - 要格挡的伤害比例
      horizontalBlockingAngle - 攻击将被格挡的最大角度
      返回:
      已添加到此物品的 伤害减免 实例
    • addDamageReduction

      @NotNull @NotNull BlocksAttacksComponent.DamageReduction addDamageReduction(@NotNull @NotNull Collection<DamageType> types, float base, float factor, float horizontalBlockingAngle)
      向此组件添加一个新的伤害减免, 该减免针对特定类型的攻击.

      原文: Add a new damage reduction to this component, which blocks specific types of attacks.

      参数:
      types - 攻击类型集合
      base - 要格挡的固定伤害值
      factor - 要格挡的伤害比例
      horizontalBlockingAngle - 攻击将被格挡的最大角度
      返回:
      已添加到此物品的 伤害减免 实例
    • addDamageReduction

      @NotNull @NotNull BlocksAttacksComponent.DamageReduction addDamageReduction(@NotNull @NotNull Tag<DamageType> tag, float base, float factor, float horizontalBlockingAngle)
      向此组件添加一个新的伤害减免, 该减免针对特定类型的攻击.

      原文: Add a new damage reduction to this component, which blocks specific types of attacks.

      参数:
      tag - 攻击类型标签
      base - 要格挡的固定伤害值
      factor - 要格挡的伤害比例
      horizontalBlockingAngle - 攻击将被格挡的最大角度
      返回:
      已添加到此物品的 伤害减免 实例
    • removeDamageReduction

      boolean removeDamageReduction(@NotNull @NotNull BlocksAttacksComponent.DamageReduction reduction)
      从此物品中移除给定的 伤害减免.

      原文: Remove the given BlocksAttacksComponent.DamageReduction from this item.

      参数:
      reduction - 要移除的伤害减免
      返回:
      如果成功移除了减免则返回 true, 如果此组件不包含匹配的减免则返回 false
    • getItemDamageThreshold

      float getItemDamageThreshold()
      获取在物品也开始承受伤害之前, 需要被格挡的伤害量阈值.

      原文: Gets the amount of damage required to be dealt before damage is also applied to the item.

      返回:
      阈值伤害量
    • setItemDamageThreshold

      void setItemDamageThreshold(float threshold)
      设置在物品也开始承受伤害之前, 需要被格挡的伤害量阈值.

      原文: Sets the amount of damage required to be dealt before damage is also applied to the item.

      参数:
      threshold - 新的阈值伤害量
    • getItemDamageBase

      float getItemDamageBase()
      获取如果达到伤害阈值, 将应用于物品的固定伤害值.

      原文: Gets the constant amount of damage applied to the item if the threshold is reached.

      返回:
      物品基础伤害值
    • setItemDamageBase

      void setItemDamageBase(float base)
      设置如果达到伤害阈值, 将应用于物品的固定伤害值.

      原文: Sets the constant amount of damage applied to the item if the threshold is reached.

      参数:
      base - 新的物品基础伤害值
    • getItemDamageFactor

      float getItemDamageFactor()
      获取如果达到伤害阈值, 将应用于物品的伤害比例.

      原文: Gets the proportion of damage applied to the item if the threshold is reached.

      返回:
      物品伤害系数
    • setItemDamageFactor

      void setItemDamageFactor(float factor)
      设置如果达到伤害阈值, 将应用于物品的伤害比例.

      原文: Sets the proportion of damage applied to the item if the threshold is reached.

      参数:
      factor - 新的物品伤害系数
    • getBlockSound

      @Nullable @Nullable Sound getBlockSound()
      获取物品格挡攻击时播放的音效.

      原文: Gets the sound to play when the item blocks an attack.

      返回:
      音效
    • setBlockSound

      void setBlockSound(@Nullable @Nullable Sound sound)
      设置物品格挡攻击时播放的音效.

      原文: Sets the sound to play when the item blocks an attack.

      参数:
      sound - 音效, 或设置为 null 以使用当前默认值
    • getDisableSound

      @Nullable @Nullable Sound getDisableSound()
      获取物品被"缴械"时播放的音效.

      原文: Gets the sound to play when the item is disabled.

      返回:
      音效
    • setDisableSound

      void setDisableSound(@Nullable @Nullable Sound sound)
      设置物品被"缴械"时播放的音效.

      原文: Sets the sound to play when the item is disabled.

      参数:
      sound - 音效, 或设置为 null 以使用当前默认值
    • getBypassedBy

      @Nullable @Nullable Tag<DamageType> getBypassedBy()
      获取将会绕过此物品格挡的伤害类型.

      原文: Gets the type of damage that will bypass blocking by this item.

      返回:
      伤害类型标签
    • setBypassedBy

      void setBypassedBy(@Nullable @Nullable Tag<DamageType> tag)
      设置将会绕过此物品格挡的伤害类型.

      原文: Sets the type of damage that will bypass blocking by this item.

      参数:
      tag - 伤害类型标签, 或设置为 null 以清除