bedrock-skript
v1.0.0
Published
A Skript-like DSL compiler for Minecraft Bedrock Script API
Maintainers
Readme
Skript-Bedrock
A Skript-inspired DSL compiler for Minecraft Bedrock Script API, written in TypeScript.
Features
- Compile
.bskfiles into Bedrock-compatible JavaScript - Runtime events, expressions, conditions, and effects inspired by Java Skript
- Permanent variables using dynamic world properties when available
- Keyed variables such as
{coins::%name of player%} - Built-in examples and syntax documentation
Install
npm install bedrock-skriptBuild
npm run buildTest
npm testCLI Usage
Compile .bsk files from a source folder into a destination folder.
bedrock-skriptBy default:
sourceDir = skriptsoutDir = scripts
Custom directories are supported:
bedrock-skript custom-skripts custom-scriptsThe CLI also attempts to update your manifest.json entry point with generated script imports.
API Usage
Use the compiler directly from code:
import { definitions } from "bedrock-skript";
const source = `on player join:\n send message \"Hello, %event-player's name%!\" to event-player`;
const result = definitions.compile(source);
if (result.errors.length > 0) {
console.error(result.errors);
} else {
console.log(result.code);
}You can also compile from a file:
const result = definitions.compileFromFile("examples/persistent-counter.bsk");Examples
The repository includes example scripts under examples/:
examples/welcome.bsk— simple join event and messageexamples/combat.bsk— event condition exampleexamples/economy.bsk— keyed permanent storage exampleexamples/persistent-counter.bsk— persistent counter example
Syntax Reference
The full syntax guide is documented in SYNTAX.md.
Package
Published package name: bedrock-skript
Repository: https://github.com/Logan-Viveiros/Bedrock-Skript
Contributing
Changes should include tests and compile cleanly with:
npm test
npm run buildLicense
No license is specified in this repository.
