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
    After events

    ItemSpawnAfterEvent

    Interface in @minecraft/server

    Basalt’s own: an item came into the world, dropped, thrown or spilled from a block.

    import type { ItemSpawnAfterEvent } from '@minecraft/server';

    Subscribe to it with world.afterEvents.itemSpawn.

    import { world, type ItemSpawnAfterEvent } from '@minecraft/server';
    world.afterEvents.itemSpawn.subscribe((event: ItemSpawnAfterEvent) => {
    console.log('itemSpawn', event.entity.typeId, event.itemStack?.typeId);
    });
    import { world } from '@minecraft/server';
    world.afterEvents.itemSpawn.subscribe((event) => {
    console.log('itemSpawn', event.entity.typeId, event.itemStack?.typeId);
    });

    read-only

    readonly entity: ItemEntity;

    read-only

    readonly itemStack: ItemStack | undefined;

    read-only

    readonly location: Vector3;
    Types

    WorldAfterEvents.itemSpawn