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

    ProjectileHitBlockAfterEvent

    Interface in @minecraft/server

    An arrow, trident or thrown thing hit a block.

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

    Subscribe to it with world.afterEvents.projectileHitBlock.

    import { world, type ProjectileHitBlockAfterEvent } from '@minecraft/server';
    world.afterEvents.projectileHitBlock.subscribe((event: ProjectileHitBlockAfterEvent) => {
    console.log('projectileHitBlock', event.dimension.id, event.projectile.typeId, event.source?.typeId);
    });
    import { world } from '@minecraft/server';
    world.afterEvents.projectileHitBlock.subscribe((event) => {
    console.log('projectileHitBlock', event.dimension.id, event.projectile.typeId, event.source?.typeId);
    });

    read-only

    readonly dimension: Dimension;

    read-only

    readonly hitVector: Vector3;

    Which way it was flying, as a unit vector.

    Types

    read-only

    readonly location: Vector3;
    Types

    read-only

    readonly projectile: Entity;
    Types

    read-only

    readonly source: Entity | undefined;

    Who shot or threw it.

    Types
    getBlockHit(): BlockHitInformation;
    Returns
    BlockHitInformation

    WorldAfterEvents.projectileHitBlock, ProjectileHitBlockAfterEventSignal.subscribe, ProjectileHitBlockAfterEventSignal.unsubscribe