For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/ItemUseBeforeEventSignal.md.

Class: ItemUseBeforeEventSignal

event

Beta

管理物品使用前触发的回调。

Manages callbacks that fire before an item is used.

Methods

subscribe()

subscribe(callback): (arg0) => void

World Mutation Early Execution Beta

Parameters

callback

(arg0) => void

Tip

This closure is called with restricted-execution privilege.

Returns

Tip

Closure that is called with restricted-execution privilege.

(arg0) => void

Remarks

添加一个回调,在物品被使用之前将被调用。

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


unsubscribe()

unsubscribe(callback): void

World Mutation Early Execution Beta

Parameters

callback

(arg0) => void

Tip

This closure is called with restricted-execution privilege.

Returns

void

Remarks

移除一个回调,使物品被使用之前不再被调用。

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

同领域相关