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
    @minecraft/server-net

    PacketSendBeforeEvent

    Interface in @minecraft/server-net

    A packet about to go to a player in a batch.

    import type { PacketSendBeforeEvent } from '@minecraft/server-net';

    Subscribe to it with beforeEvents.packetSend.

    import { beforeEvents, type PacketSendBeforeEvent } from '@minecraft/server-net';
    beforeEvents.packetSend.subscribe((event: PacketSendBeforeEvent) => {
    console.log('packetSend', event.packetId, event.packetSize);
    // Uncomment to stop it from happening.
    // event.cancel = true;
    });
    import { beforeEvents } from '@minecraft/server-net';
    beforeEvents.packetSend.subscribe((event) => {
    console.log('packetSend', event.packetId, event.packetSize);
    // Uncomment to stop it from happening.
    // event.cancel = true;
    });
    cancel: boolean;

    Set to true to leave it out of the batch.

    read-only

    readonly packetId: PacketId;

    read-only

    readonly packetSize: number;

    read-only

    readonly recipients: (Player | undefined)[];

    Who it goes to; Basalt fires once for each, so this holds one.

    Types

    NetworkBeforeEvents.packetSend