Skip to content

@minecraft/server


@minecraft/server / PlayerInteractWithEntityBeforeEventSignal

Class: PlayerInteractWithEntityBeforeEventSignal ​

Defined in: @minecraft/server/index.d.ts:17885

Manages callbacks that are connected to before a player interacts with an entity.

Methods ​

subscribe() ​

subscribe(callback): (arg0) => void

Defined in: @minecraft/server/index.d.ts:17901

Parameters ​

callback ​

(arg0) => void

This closure is called with restricted-execution privilege.

Returns ​

Closure that is called with restricted-execution privilege.

(arg0) => void

Remarks ​

Adds a callback that will be called before a player interacts with an entity.

This function can't be called in restricted-execution mode.

This function can be called in early-execution mode.


unsubscribe() ​

unsubscribe(callback): void

Defined in: @minecraft/server/index.d.ts:17916

Parameters ​

callback ​

(arg0) => void

This closure is called with restricted-execution privilege.

Returns ​

void

Remarks ​

Removes a callback from being called before a player interacts with an entity.

This function can't be called in restricted-execution mode.

This function can be called in early-execution mode.