世界修改damage只读is只读max只读type世界修改unbreakable静态 只读component世界修改
可选unbreakingEnchantmentLevel: number
耐久魔咒等级,在计算损坏概率时受到此参数的影响。
传入的 unbreakingEnchantmentLevel 参数必须介于 [0, 3]。
Unbreaking factor to consider in factoring the damage chance. Incoming unbreaking parameter must be within the range [0, 3]. Defaults to: 0 Bounds: [0, 3]
使用时的最大损坏概率。
返回根据 damageRange 属性生成的最大损坏概率,
附带一个耐久附魔等级作为可选参数。
Returns the maximum chance that this item would be damaged using the damageRange property, given an unbreaking enchantment level.
TypeError - 若 unbreakingEnchantmentLevel 参数未在范围内
世界修改
表示物品耐久组件。当出现在物品上时,表示该物品可以在使用中受到损坏。 注意,只能在数驱物品上获取和使用该组件。
When present on an item, this item can take damage in the process of being used. Note that this component only applies to data-driven items.
示例: giveHurtDiamondSword.ts