Перейти к основному содержанию

ArmorListeners

Implemented by

Index

Methods

optionalonHurt

  • onHurt(params: { attacker: number; bool1: boolean; bool2: boolean; damage: number; type: number }, item: ItemInstance, slot: number, player: number): any
  • This event is called when the damage is dealt to the player that has this armor put on.


    Parameters

    • params: { attacker: number; bool1: boolean; bool2: boolean; damage: number; type: number }

      additional data about damage

      • attacker: number

        attacker entity or -1 if the damage was not caused by an entity

      • bool1: boolean
      • bool2: boolean
      • damage: number

        damage amount that was applied to the player

      • type: number

        damage type

    • item: ItemInstance

      armor item instance

    • slot: number

      armor slot index (from 0 to 3).

    • player: number

      player entity uid

    Returns any

    the item instance to change armor item, if nothing is returned, armor will be damaged by default.

optionalonTakeOff

  • onTakeOff(item: ItemInstance, slot: number, player: number): void
  • This event is called when player takes off or changes this armor item.


    Parameters

    • item: ItemInstance

      armor item instance

    • slot: number

      armor slot index (from 0 to 3).

    • player: number

      player entity uid

    Returns void

optionalonTakeOn

  • onTakeOn(item: ItemInstance, slot: number, player: number): void
  • This event is called when player takes on this armor, or spawns with it.


    Parameters

    • item: ItemInstance

      armor item instance

    • slot: number

      armor slot index (from 0 to 3).

    • player: number

      player entity uid

    Returns void

optionalonTick

  • onTick(item: ItemInstance, slot: number, player: number): any
  • This event is called when the damage is dealt to the player that has this armor put on.


    Parameters

    • item: ItemInstance

      armor item instance

    • slot: number

      armor slot index (from 0 to 3).

    • player: number

      player entity uid

    Returns any

    the item instance to change armor item, if nothing is returned, armor will not be changed.

Page Options