Minecraft Bedrock Scripting: Write Script API Code in Your Browser

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

  1. Add a Script

    In your project, tap Add item and choose Script.

  2. Start from an example

    Pick an example such as Welcome message, Custom command, Menu form or Every 10 seconds, or write your own.

  3. Use the ready-made names

    world, system, ActionFormData, ModalFormData and MessageFormData are already imported, so you can use them straight away.

  4. Export and test

    Tap Export and test in a world. Errors show in Minecraft's content log.

  5. Turn on the Content Log

    In Minecraft's Creator settings, turn on Content Log so you can see script errors while you play.

Tips

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

FunctionsLogic & scriptsCustom menuScreens & cameraCustom HUDScreens & camera

Try it free

Addon's Studio runs in your browser. No download, no coding.

Start making it