SerenityJS
    Preparing search index...

    Class ItemStackDurabilityTrait

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    identifier: string = ...

    The identifier of the trait.

    item: ItemStack

    The item stack that this trait is attached to.

    component: typeof ItemTypeDurabilityComponent = ItemTypeDurabilityComponent

    The item component(s) that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.

    identifier: "durability"

    The identifier of the trait.

    tag: string[] = ...

    The item tag(s) that this trait is compatible with by default. If null, the trait will not attach to any item stack by default.

    types: string[] = []

    The item type identifiers that this trait is compatible with by default.

    Methods

    • Get the maximum chance that this item would be damaged using the damageRange property, given an unbreaking enchantment level.

      Parameters

      • unbreakingEnchantmentLevel: number = 0

      Returns number

      The damage chance of the item stack.