Skip to content
BasaltSoftware
Bedrock 1.26.60

Site colour

Discord
Esc

    ↑↓ moveEnter openEsc close

    Keyboard shortcuts
    Ctrl K
    Search the whole site, from any page
    /
    Jump to the sidebar search, or search the whole site where there isn't one
    Enter
    Open the top search result
    Esc
    Clear the search, or close this panel
    ?
    Show these shortcuts
    Before events

    EntityRemoveBeforeEvent

    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.

    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);
    });

    read-only

    readonly removedEntity: Entity;
    Types

    WorldBeforeEvents.entityRemove, EntityRemoveBeforeEventSignal.subscribe, EntityRemoveBeforeEventSignal.unsubscribe