🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

socket-be

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

socket-be

This is a tool to connect with MinecraftBE via websocket easier.

2.0.1
latest
Source
npm
Version published
Weekly downloads
28
-24.32%
Maintainers
1
Weekly downloads
 
Created
Source

English | 日本語

SocketBE

A powerful websocket library to interact with MCBE WebSocket Protocol

image

Features

  • Fully typed vanilla event handler
  • Command execution + Handling responses
  • Multiple connection support
  • Various wrapper APIs (World, Player, Scoreboard, etc.)
  • Encryption support

Installation:

Requires Node.js v18 or later.

npm install socket-be

Running:

If you use this inside same device, allow the loopback connection.
CheckNetIsolation.exe LoopbackExempt -a -n="Microsoft.MinecraftUWP_8wekyb3d8bbwe"

You can use /wsserver or /connect command to connect with websocket server.
EX: /wsserver <IP Address>:<PORT>

Usage

  • Outputs received messages in console, and send back to mc
import { Server, ServerEvent } from 'socket-be';

const server = new Server({ port: 8000 })

server.on(ServerEvent.Open, () => {
  console.log('Server started')
});

server.on(ServerEvent.PlayerChat, async ev => {
  const { sender, message, world } = ev;

  if (sender.name === 'External') return; // prevents spam loop

  console.log(`<${sender.name}> ${message}`);

  if (message === 'ping') {
    await world.sendMessage('Pong!');
  }
});

License

This project is licensed under the GPL-3.0 License.

Keywords

minecraft

FAQs

Package last updated on 11 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts