SerenityJS
    Preparing search index...

    Class PlayerCombatTrait

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    entity: Entity

    The entity that this trait is attached to.

    identifier: string = ...

    The identifier of the trait.

    isOnCooldown: boolean = false

    Whether the player is on cooldown.

    isOnCriticalCooldown: boolean = false

    Whether the player is on critical cooldown.

    player: Player = ...

    The player that this trait is attached to.

    components: string[] = []

    The entity component identifiers that this trait is compatible with by default. If empty, the trait will not be initialized by any component.

    identifier: "combat"

    The identifier of the trait.

    types: EntityIdentifier[] = ...

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

    Accessors

    Methods

    • Gets the calculated damage of the player based on the held item enchantments.

      Parameters

      • critical: boolean = false

        Whether the damage is critical.

      Returns number

      The calculated damage.

    • Starts the combat cooldown of the player.

      Parameters

      • Optionalticks: number

        The amount of ticks to cooldown the player; if not provided, the default combat cooldown will be used.

      Returns void

    • Starts the critical combat cooldown of the player.

      Parameters

      • Optionalticks: number

        The amount of ticks to cooldown the player; if not provided, the default combat cooldown will be used multiplied by 5.

      Returns void