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
    Plugin API

    @minecraft/server-net

    @minecraft/server-net as Basalt provides it: its packet events, which see every packet a player sends and is sent, and may stop it; its HTTP client, http; and Basalt's own WebSocket.

    2 constants · 2 events · 7 classes · 5 interfaces · 2 enums · 1 type · 2 options
    On this page

    @minecraft/server-net as Basalt provides it: its packet events, which see every packet a player sends and is sent, and may stop it; its HTTP client, http; and Basalt’s own WebSocket.

    Requests and sockets run off the plugin’s thread and are held to basalt.toml’s script_net_enabled, script_net_allowed_hosts and script_net_max_body_bytes. BDS offers this module only to packs its config/ permissions allow.

    A handler runs while the connection waits, at most 50 ms, on every packet it hears, so narrow a subscription with PacketEventOptions. To watch without making anyone wait, use Basalt’s system.afterEvents.packetReceive and packetSend of @minecraft/server.

    import { beforeEvents } from '@minecraft/server-net';
    const beforeEvents: NetworkBeforeEvents;
    const http: HttpClient;