Skip to content

@minecraft/server


@minecraft/server / EntityHitEntityAfterEventSignal

Class: EntityHitEntityAfterEventSignal ​

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

Manages callbacks that are connected to when an entity makes a melee attack on another entity.

Methods ​

subscribe() ​

subscribe(callback, options?): (arg0) => void

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

Parameters ​

callback ​

(arg0) => void

options? ​

EntityEventOptions

Returns ​

(arg0) => void

Remarks ​

Adds a callback that will be called when an entity hits another 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:10736

Parameters ​

callback ​

(arg0) => void

Returns ​

void

Remarks ​

Removes a callback from being called when an entity makes a melee attack on another entity.

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

This function can be called in early-execution mode.