Interface in @minecraft/server
A mob about to leave the world: killed, despawned or removed.
import type { EntityRemoveBeforeEvent } from '@minecraft/server';Subscribe to it with world.beforeEvents.entityRemove.
Example
Section titled “Example”import { world, type EntityRemoveBeforeEvent } from '@minecraft/server';
world.beforeEvents.entityRemove.subscribe((event: EntityRemoveBeforeEvent) => { console.log('entityRemove', event.removedEntity.typeId);});import { world } from '@minecraft/server';
world.beforeEvents.entityRemove.subscribe((event) => { console.log('entityRemove', event.removedEntity.typeId);});Properties
Section titled “Properties”removedEntity
Section titled “removedEntity”read-only
readonly removedEntity: Entity;Types
Used by
Section titled “Used by”WorldBeforeEvents.entityRemove, EntityRemoveBeforeEventSignal.subscribe, EntityRemoveBeforeEventSignal.unsubscribe