Use certain Endstone features directly in your Bedrock add-ons through a JavaScript API. ScriptSDK bridges the gap between Minecraft Bedrock add-ons and Endstone plugin capabilities.
ScriptSDK is a dual-component system:
- JavaScript/TypeScript SDK: Import and use in your Bedrock add-ons
- Endstone Plugin: Python-based server plugin that enables the SDK functionality
- /debug : To enable/disable the plugin's communication logs.
- system.groups →
Group[]: List of groups initialise - system.getInfoFromExternalServer(ip, port) ->
ServerInfo: Provides information about an external server.
- player.ip →
string | null: Player's IP address (automatically populated when player spawns) - player.xuid →
string | null: Player's Xbox User ID (automatically populated when player spawns) - player.device_os →
string | null: Player's device OS (automatically populated when player spawns) - player.getPing() →
Promise<number>: Get the player's current ping/latency in milliseconds - player.setBossBar(title, color, style, percent) →
Promise<void>: Create and assign a boss bar to a player with customizable progress percentage (0-100) - player.resetBossBar() →
Promise<void>: Reset boss bar to a player. - player.sendToast(title, content) →
Promise<void>: Send toast notification. - player.sendPopup(message) →
Promise<void>: Send popup.
- entity.setNameTagForPlayer(target, newName) →
Promise<void>: Set custom entity name visible to specific players - entity.resetNameTagForPlayer(target) →
Promise<void>: Reset custom entity name to default for a specific target player - entity.getNameTagByPlayer(target) →
string: Get the custom name tag that a specific entity sees for this player
Create and manage player groups with custom rules:
import { Group } from 'lib/ScriptSDK';
import { GroupRule } from 'lib/src/enums';
// Create a new group with a rule
const safeZone = new Group('SafeZone', GroupRule.NO_DAMAGE);
// Initialize the group (required before using it)
await safeZone.init();
// Add players to the group
await safeZone.addPlayer(player);
// Remove players from the group
await safeZone.removePlayer(player);
// Get all players in the group
const groupPlayers = safeZone.getPlayers();
// Destroy the group
await safeZone.destroy();Group Properties:
name→string: The name of the grouprule→GroupRule: The rule applied to the groupis_created→boolean: Whether the group was successfully createdis_destroy→boolean: Whether the group has been destroyed
Group Methods:
init()→Promise<void>: Initialize the group on the server (must be called before using the group)addPlayer(player | playerName)→Promise<void>: Add a player to the groupremovePlayer(player | playerName)→Promise<void>: Remove a player from the grouphasPlayer(player | playerName)→boolean: Returns a boolean value indicating whether the player is in the groupgetPlayers()→Player[]: Get all players in the groupdestroy()→Promise<void>: Delete the group and remove all players from ittoJson()→object: Export group to json
Available Rules:
GroupRule.NO_PVP(0) - Players in the group cannot attack each otherGroupRule.NO_DAMAGE(1) - Players in the group take no damage from any sourceGroupRule.PVP_ONLY_GROUP(3) - Players can only attack other players in the same groupGroupRule.NO_PVP_NO_DAMAGE(4) - Combination of NO_PVP and NO_DAMAGE rulesGroupRule.NO_PVP_ONLY_GROUP(5) - Players in the group cannot attack each other (PVP disabled within group only)
Available Colors:
BossBarColor.BLUE(0) - Blue boss barBossBarColor.GREEN(1) - Green boss barBossBarColor.PINK(2) - Pink boss barBossBarColor.PURPLE(3) - Purple boss barBossBarColor.REBECCA_PURPLE(4) - Rebecca purple boss barBossBarColor.RED(5) - Red boss barBossBarColor.WHITE(6) - White boss barBossBarColor.YELLOW(7) - Yellow boss bar
Available Styles:
BossBarStyle.SOLID(0) - Solid progress barBossBarStyle.SEGMENTED_6(1) - 6 segmentsBossBarStyle.SEGMENTED_10(2) - 10 segmentsBossBarStyle.SEGMENTED_12(3) - 12 segmentsBossBarStyle.SEGMENTED_20(4) - 20 segments
- Download the latest release from GitHub Releases
- Copy the following files to your add-on project in a
libfolder.
Your add-on structure should look like:
scripts/
├── lib/
│ ├── ScriptSDK.js
│ ├── ScriptSDK.d.ts
│ └── src/...
└── your-script.js
- Download the latest plugin wheel (
.whl) from GitHub Releases - Place the
.whlfile in your Endstone server'spluginsfolder - Restart your server
After copying the SDK files to your lib folder, import it in your main file:
import 'lib/ScriptSDK'; // Initialisation of the libraryFull TypeScript support with type definitions included:
import { Player } from '@minecraft/server';
import { BossBarColor, BossBarStyle } from 'lib/ScriptSDK';
import { GroupRule } from 'lib/src/enums';
import { Group } from 'lib/src/groups';
// TypeScript will provide autocomplete and type checking
const pvpGroup = new Group('PvPArena', GroupRule.PVP_ONLY_GROUP);
// Initialize the group before using it
await pvpGroup.init();
const setupPlayer = async (player: Player) => {
await player.setBossBar('Health Bar', BossBarColor.RED, BossBarStyle.SOLID, 80);
await pvpGroup.addPlayer(player);
};This project is licensed under the GPL-2.0 License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please open an issue on GitHub.