The EntityRemoveAfterEvent interface in @minecraft/server.
Interface in @minecraft/server
import type { EntityRemoveAfterEvent } from '@minecraft/server';Subscribe to it with world.afterEvents.entityRemove.
Example
Section titled “Example”import { world, type EntityRemoveAfterEvent } from '@minecraft/server';
world.afterEvents.entityRemove.subscribe((event: EntityRemoveAfterEvent) => { console.log('entityRemove', event.removedEntityId, event.typeId);});import { world } from '@minecraft/server';
world.afterEvents.entityRemove.subscribe((event) => { console.log('entityRemove', event.removedEntityId, event.typeId);});Properties
Section titled “Properties”removedEntityId
Section titled “removedEntityId”read-only
readonly removedEntityId: string;typeId
Section titled “typeId”read-only
readonly typeId: string;Used by
Section titled “Used by”WorldAfterEvents.entityRemove, EntityRemoveAfterEventSignal.subscribe, EntityRemoveAfterEventSignal.unsubscribe