Guides › Logic & scripts
The Script API lets add-ons run JavaScript inside Minecraft Bedrock. Scripts can react to events, change the world, show forms and do things commands alone can't. They use Minecraft's @minecraft/server module.
The Script editor in Addon's Studio is for players who want to code. It sets up the add-on files for you, so you can focus on the JavaScript. If you'd rather not code, functions, menus and actions cover a lot without it.
Make one now in Addon's Studio
Step by step
Add a Script
In your project, tap Add item and choose Script.
Start from an example
Pick an example such as Welcome message, Custom command, Menu form or Every 10 seconds, or write your own.
Use the ready-made names
world, system, ActionFormData, ModalFormData and MessageFormData are already imported, so you can use them straight away.
Export and test
Tap Export and test in a world. Errors show in Minecraft's content log.
Turn on the Content Log
In Minecraft's Creator settings, turn on Content Log so you can see script errors while you play.
Tips
- Scripts run on Minecraft's Script API (@minecraft/server).
- Imported an add-on with its own scripts? Under Pack files, long-press or right-click a script and switch on Starts with the world to make it a main script.
- Keep heavy work out of code that runs every tick, especially for phone players.
- Not ready to code? Functions and Menus do many common jobs without JavaScript.
Questions
Do I need to know JavaScript?
For the Script editor, a little. Start from an example and change it. Everything else in Addon's Studio works without code.
Where do I see script errors?
In Minecraft's content log. Turn on Content Log in Creator settings, then play the world again.
Do scripts work on all devices?
Yes. Scripts run inside Minecraft Bedrock, so they work wherever the add-on is active, including Realms and servers that console players join.
Related guides
Try it free
Addon's Studio runs in your browser. No download, no coding.