Skip to content

two-way communication system between ScriptAPI and backend server using http request

Notifications You must be signed in to change notification settings

tutinoko2048/ScriptBridge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ScriptBridge

Server

Installation

  • npm
npm install @script-bridge/server
  • yarn
yarn add @script-bridge/server
  • pnpm
pnpm add @script-bridge/server
  • bun
bun install @script-bridge/server

Example

  • JavaScript
const { ScriptBridgeServer } = require('@script-bridge/server');
const server = new ScriptBridgeServer({ port: 8000 });
server.start();
  • TypeScript
import { ScriptBridgeServer } from '@script-bridge/server';
const server = new ScriptBridgeServer({ port: 8000 });
server.start();

Client

Usage

  • Download the client from the releases page.
  • Put the client in your project.

Note

You need to enable Beta API toggle and allow @minecraft/server-net module in [BDS]/config/permissions.json.

Example

import { ScriptBridgeClient } from './path/to/script-bridge-client';
const client = new ScriptBridgeClient({ url: 'http://localhost:8000' });
client.connect();

About

two-way communication system between ScriptAPI and backend server using http request

Resources

Stars

Watchers

Forks