中文文档 (Chinese) | API Documentation
Unleash the power of JavaScript in Minecraft. ScriptBridge-Fabric bridges the gap between Minecraft internals and runtime scripting, allowing you to run dynamic JavaScript code on both the client and server sides without restarting the game.
ScriptBridge-Fabric is a developer-friendly mod that embeds the GraalVM JavaScript engine into Minecraft. Unlike simple macro mods, ScriptBridge provides:
net.minecraft.* classes directly. The engine automatically resolves mappings, so your scripts work in both Dev (Named) and Production (Intermediary) environments!ScriptPlayer, ScriptWorld, and ScriptInventory APIs for stable and easy scripting./script reload.game object with rich wrappers (game.getPlayer(), game.getWorld()).net.minecraft.client.MinecraftClient and let the mod handle the rest.Runtime, Process, IO) are blocked for security.(Add your screenshots here. For example: A script sending a chat message, or a server script spawning a structure.)
| Client Script Demo | Server Management |
|---|---|
![]() | ![]() |
| Custom HUD logic | Admin tools in action |
scriptbridge-fabric-*.jar from the Releases page..minecraft/mods folder.scripts directory will be created automatically.After the first launch, you will see a scripts folder in your game directory:
.minecraft/ └── scripts/ ├── client/ <-- Scripts here run on your local client └── server/ <-- Scripts here run on the internal/dedicated server
Create a file named hello.js in scripts/client/:
// scripts/client/hello.js
var player = game.getPlayer();
if (player) {
player.chat("Hello " + player.getName() + "!");
player.jump();
}
Run it in-game:
/script run hello.js
| Command | Description |
|---|---|
/script run <file> | Run a script (defaults to client side). |
/script reload | Reload all scripts and refresh the engine. |
/script list | Show available scripts. |
/script debug | Toggle debug output in chat. |
/script openfile | Open the scripts folder in your OS file manager. |
ScriptBridge offers a two-layered API.
Helper API: Quick and easy.
game.getPlayer() -> Returns ScriptPlayer wrapper.game.getWorld() -> Returns ScriptWorld wrapper.game.setClipboard(text)Native API: Full Java access with auto-remapping.
// Works everywhere!
const MinecraftClient = Java.type('net.minecraft.client.MinecraftClient');
👉 Read the Full API Documentation
We provide TypeScript definitions for a better coding experience.
scripts folder in VS Code.scriptbridge.d.ts (found in the mod source or repo) to your workspace.game and Java objects!We welcome Pull Requests! Please see CONTRIBUTING.md for details.
This project is licensed under the MIT License.
Made with ❤️ by MingPixel