Downloads
Script Interpreter is a debugging tool for Minecraft Scripting. It is a Bedrock add-on allows user to run JavaScript code within Minecraft Bedrock. This is great to use for debugging, prototyping, and learning JavaScript and Minecraft's scripting API.
Minecraft scripting involves using the JavaScript (or TypeScript) programming language to create interactive experiences and gameplay mechanics in Minecraft. It is one of the ways to mod Minecraft with Add-Ons.
If you're new to JavaScript development, you are advised to learn JavaScript free from online courses available online before writing scripts for Minecraft, such as the following:
You are also advised to learn how to write scripts using Minecraft's Script API before using this add-on, as this add-on is not a tutorial to Script API. Check out Introduction to Scripting in Minecraft for more information.
This add-on allows developers to debug JavaScript code and reports an error condition immediately in Minecraft in-game using this interpreter. This reduces the amount of script errors happened in your code development and time, and allows developers to experiment with the new features available in Script API modules in Minecraft.
However you can only run JavaScript code in this add-on, because the scripting engine only supports JavaScript.
Here are some examples executing JavaScript in-game:
Get it? Cause Aether dimension does not exist in Minecraft.
JavaScript Interpreter [Use]
item through the following methods:/function statistics
JavaScript Interpreter [Use]
to open the interpreterIn case you want to disable your code, you have to run /reload
command which requires operator permission to execute the command.
The Script Block can store and execute JavaScript code in a Minecraft world. It cannot be obtained or used in Survival mode without cheats.
The script blocks can either be obtained by using various commands, such as /give @s interpreter:script_block
or /setblock ~ ~ ~ interpreter:script_block
, or by pressing the pick block control on an existing script block.
Script blocks are not flammable, and have the same blast resistance as bedrock. They cannot cannot be mined in Survival mode, however they can be pushed with pistons and sticky pistons and the data inside the block persists.
A script block can execute JavaScript code when activated by pressure plates and buttons currently. Script output is displayed when player activates the script block.
To enter command or modify the script block, players must interact with the script block. The scripts can be entered in the text input within the modal form. The text limit for scripts in a script block is 32,767 characters, you can scroll through lines of code just like the NPC text prompt UI.
Scripts in a script block do not need to be prefixed with imports (e.g. import { world } from "@minecraft/server"
) as they do in the actual JavaScript files.
When finished inputing JavaScript code, save the code into the script block by pressing 'Save' button. Upon pressing the button it will not immediately execute scripts unlike the Script Interpreter item.
This add-on allows you to add scripts to run automatically when Minecraft loads the add-on. Here's how:
Open Startup Scripts form by typing /function repl/startup
, and hitting Enter.
Click on 'Create New' button on the form.
A new form appears with an input field, give your task a name (e.g., "Run Block Filling Procedure") and check Add Script Code to write scripts for the task.
press 'Add Script Code', which redirects you to write some scripts for the task.
After writing the script, Click 'Save Scripts' to finish setting it up.
This should automatically launch the task when you load the add-on.
The add-on also provides function commands to access Script Interpreter.
/function repl
: Access Script Interpreter/function repl/startup
: Access Script Startup settings/function repl/shutdown
: Access Script Shutdown settingsThe add-on also provides custom slash commands to access Script Interpreter.
/jayly:interpreter
- Opens Interpreter./jayly:javascript
- Opens the JavaScript interpreter./jayly:version
- Displays the version of the interpreter./jayly:scriptdata
- Manage script data (options: clear
, stats
)./jayly:help
- Displays help information about available commands.This add-on allows you to add scripts to run automatically when Minecraft is shutting down. Here's how:
Open shutdown Scripts form by typing /function repl/shutdown
, and hitting Enter.
Click on 'Create New' button on the form.
A new form appears with an input field, give your task a name (e.g., "Run Cleanup Procedure") and check Add Script Code to write scripts for the task.
press 'Add Script Code', which redirects you to write some scripts for the task.
After writing the script, Click 'Save Scripts' to finish setting it up.
This should automatically launch the task when the world shuts, or when before shutdown event is called.
This is a very old showcase video of the add-on, fun fact the video includes the ability to run TypeScript code because this add-on used to be able to run TypeScript code.
First you go to the download section and click "Download Script Interpreter" (with or without experimentals), then the add-on will be downloaded to your device.
Import the add-on to Minecraft.
Important
Enable Beta APIs experiments in world settings. These experiments are needed to run Script Interpreter with Beta API features.
Enable Experiments in New Create World Screen
No experimental toggles needed to be enabled.
Some script modules are not enabled by the add-on by default. You can enable the following modules through modifying the behavior pack's manifest.json file.
The add-on enables the following modules by default:
Stable API Pack
@minecraft/server
(Cannot be removed)@minecraft/server-ui
(Cannot be removed)Beta API Pack
@minecraft/server
(Cannot be removed)@minecraft/server-ui
(Cannot be removed)@minecraft/server-gametest
@minecraft/debug-utilities
@minecraft/server-admin
Optional Modules
Editor API:
Important
Editor API can only be used in Editor projects.
Add the following to manifest dependencies list:
{
"module_name": "@minecraft/server-editor",
"version": "0.1.0-beta"
}
Check Editor API Reference for latest manifest details
@minecraft/server-net
module:
Important
The @minecraft/server-net
module can only be used in Bedrock Dedicated Server.
Add the following to manifest dependencies list:
{
"module_name": "@minecraft/server-net",
"version": "0.1.0-beta"
}
Check
@minecraft/server-net
Reference for latest manifest details
@minecraft/diagnostics
module (Preview only):
Important
The @minecraft/diagnostics
module can only be used in Bedrock Dedicated Server.
Add the following to manifest dependencies list:
{
"module_name": "@minecraft/diagnostics",
"version": "1.0.0-beta"
}
Check
@minecraft/diagnostics
Reference for latest manifest details
The Bedrock Dedicated Server version of the Script Interpreter Add-On allows players to access higher levels of Script APIs. The following modules are exclusive to Bedrock Dedicated Servers:
@minecraft/server-net
module - Can send HTTP requests from the Bedrock server, and inspect Bedrock server packets.@minecraft/diagnostics
module - Contains diagnostics functionality for reporting bugs to Sentry.@minecraft/debug-utilities
module - It's enabled on Minecraft clients but not Bedrock Dedicated Servers or Minecraft Realms by default.To use this add-on, you would have to enable some modules in the Bedrock Dedicated Server folder. This allows this version of the add-on to be used.
Install Bedrock Dedicated Server
bedrock-server
│ allowlist.json
│ bedrock_server.exe
│ bedrock_server_how_to.html
│ permissions.json
│ release-notes.txt
│ server.properties
│
├─behavior_packs
├─config
│ └─default
│ permissions.json
│
├─definitions
└─resource_packs
config/<pack_id>/permissions.json
or config/default/permissions.json
, enable @minecraft/server-net
module, the @minecraft/diagnostics
module and the @minecraft/debug-utilities
module by adding the following in the allowed_modules key. These module is not enabled by default in the server.{
"allowed_modules": [
"@minecraft/server-gametest",
"@minecraft/server",
"@minecraft/server-ui",
"@minecraft/server-admin",
+ "@minecraft/server-net",
+ "@minecraft/debug-utilities",
+ "@minecraft/diagnostics",
"@minecraft/server-editor"
]
}
Full file (config/default/permissions.json
):
{
"allowed_modules": [
"@minecraft/server-gametest",
"@minecraft/server",
"@minecraft/server-ui",
"@minecraft/server-admin",
"@minecraft/server-net",
"@minecraft/debug-utilities",
"@minecraft/diagnostics",
"@minecraft/server-editor"
]
}
Important
Enable Beta APIs experiments in world settings. This is needed to run Script Interpreter with Beta API features.