@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.
@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';Events
Section titled “Events”beforeEvents.packetReceive
PacketbeforeEvents.packetSend
Classes
Section titled “Classes”HttpClient.request.
HttpHttpRequest, whatever its status.
Networkws or wss connection, text messages each way.
Interfaces
Section titled “Interfaces”WebSocket closing.
WebWebSocket that failed; a close event follows.
WebWebSocket message.
WebWebSocket that opened.
HttpRequest may use.
PacketOptions
Section titled “Options”WebSocket is opened with.
Constants
Section titled “Constants”beforeEvents
Section titled “beforeEvents”const beforeEvents: NetworkBeforeEvents;const http: HttpClient;