跳到主要内容

Class: ItemUseBeforeEventSignal

Manages callbacks that fire before an item is used.

Constructors

new ItemUseBeforeEventSignal()

private new ItemUseBeforeEventSignal(): ItemUseBeforeEventSignal

Returns

ItemUseBeforeEventSignal

Methods

subscribe()

subscribe(callback): (arg) => void

Parameters

ParameterType
callback(arg) => void

Returns

Function

Parameters
ParameterType
argItemUseBeforeEvent
Returns

void

Remarks

Adds a callback that will be called before an item is used.

This function can't be called in read-only mode.


unsubscribe()

unsubscribe(callback): void

Parameters

ParameterType
callback(arg) => void

Returns

void

Remarks

Removes a callback from being called before an item is used.

This function can't be called in read-only mode.

Throws

This function can throw errors.