接口 BlocksAttacksComponent
- 所有超级接口:
ConfigurationSerializable
原文: Represents a component which can turn any item into a shield-like item which blocks attack damage.
-
嵌套类概要
嵌套类 -
方法概要
修饰符和类型方法说明addDamageReduction(@NotNull Collection<DamageType> types, float base, float factor, float horizontalBlockingAngle) 向此组件添加一个新的伤害减免, 该减免针对特定类型的攻击.addDamageReduction(@NotNull DamageType type, float base, float factor, float horizontalBlockingAngle) 向此组件添加一个新的伤害减免, 该减免针对特定类型的攻击.addDamageReduction(@NotNull Tag<DamageType> tag, float base, float factor, float horizontalBlockingAngle) 向此组件添加一个新的伤害减免, 该减免针对特定类型的攻击.float获取装备此物品后, 在开始格挡攻击前的延迟时间.获取物品格挡攻击时播放的音效.获取将会绕过此物品格挡的伤害类型.获取适用于此物品的伤害减免列表.float获取当被一个能造成"缴械"效果的攻击击中时, 应用于物品冷却时间的倍增系数.获取物品被"缴械"时播放的音效.float获取如果达到伤害阈值, 将应用于物品的固定伤害值.float获取如果达到伤害阈值, 将应用于物品的伤害比例.float获取在物品也开始承受伤害之前, 需要被格挡的伤害量阈值.boolean从此物品中移除给定的伤害减免.voidsetBlockDelaySeconds(float seconds) 设置装备此物品后, 在开始格挡攻击前的延迟时间.voidsetBlockSound(@Nullable Sound sound) 设置物品格挡攻击时播放的音效.voidsetBypassedBy(@Nullable Tag<DamageType> tag) 设置将会绕过此物品格挡的伤害类型.void设置要应用于此物品的伤害减免列表.voidsetDisableCooldownScale(float scale) 设置当被一个能造成"缴械"效果的攻击击中时, 应用于物品冷却时间的倍增系数.voidsetDisableSound(@Nullable Sound sound) 设置物品被"缴械"时播放的音效.voidsetItemDamageBase(float base) 设置如果达到伤害阈值, 将应用于物品的固定伤害值.voidsetItemDamageFactor(float factor) 设置如果达到伤害阈值, 将应用于物品的伤害比例.voidsetItemDamageThreshold(float threshold) 设置在物品也开始承受伤害之前, 需要被格挡的伤害量阈值.从接口继承的方法 org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
方法详细资料
-
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
DamageReductionsthat apply to this item.- 返回:
- 所有伤害减免. 返回列表的可变性无法保证, 但其内容是可变的, 可以更改它们的值
-
setDamageReductions
设置要应用于此物品的伤害减免列表. 这将移除任何现有的伤害减免.原文: Set the list of
DamageReductionsto 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
从此物品中移除给定的伤害减免.原文: Remove the given
BlocksAttacksComponent.DamageReductionfrom 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
获取物品格挡攻击时播放的音效.原文: Gets the sound to play when the item blocks an attack.
- 返回:
- 音效
-
setBlockSound
设置物品格挡攻击时播放的音效.原文: Sets the sound to play when the item blocks an attack.
- 参数:
sound- 音效, 或设置为 null 以使用当前默认值
-
getDisableSound
获取物品被"缴械"时播放的音效.原文: Gets the sound to play when the item is disabled.
- 返回:
- 音效
-
setDisableSound
设置物品被"缴械"时播放的音效.原文: Sets the sound to play when the item is disabled.
- 参数:
sound- 音效, 或设置为 null 以使用当前默认值
-
getBypassedBy
获取将会绕过此物品格挡的伤害类型.原文: Gets the type of damage that will bypass blocking by this item.
- 返回:
- 伤害类型标签
-
setBypassedBy
设置将会绕过此物品格挡的伤害类型.原文: Sets the type of damage that will bypass blocking by this item.
- 参数:
tag- 伤害类型标签, 或设置为 null 以清除
-