Minecraft Script API (known as Creator API), lets you easily interact your Minecraft world using Add-Ons with JavaScript. The most common use case is to control many things and add complex behavior in a Minecraft world.
The Script API reference provides a list of functionalities Minecraft provides through Script API. If you are new to JavaScript or Minecraft Add-On, start with the guide. Once you have learned the fundamentals, you can use the reference to get more details on individual APIs each script module provides.
Minecraft Bedrock and Minecraft Preview exposes different versions of each script module in Script API, with newer features are introduced in newer versions.
Each set of Script API reference are connected to the overall Minecraft version numbering scheme (for example, 1.21.50
), with each reference provides the documentation of all latest Minecraft API modules.
You should choose a version of reference documentation that matches your Minecraft version.
Minecraft: Bedrock Edition API references: Script API - Latest
Minecraft: Bedrock Edition Preview API references: Script API - Preview
Other Minecraft Script API references: Homepage
Script API contains multiple modules with separate releases, with each module provides specific functionalities.
@minecraft/server
- A module which is essential for managing and interacting with a Minecraft world.
@minecraft/server-ui
- A module for creating simple pop-up forms that allow users to provide you with formatted inputs through submissions.
@minecraft/server-gametest
(docs) - A module for building your own tests in GameTest Framework.
@minecraft/server-editor
(docs) - A module for interacting with the Minecraft Editor API, and building an Editor extension.
@minecraft/server-net
(docs) - A module which allows for server-based HTTP request handling, and manages server packets handling within a Bedrock Dedicated Server.
@minecraft/server-admin
(docs) - A module to manage the administration in a Bedrock Dedicated Server.
@minecraft/debug-utilities
(docs) - An utility module that is used for debugging purposes.
@minecraft/diagnostics
(docs) - A module allows script modules to connect their script packs to Sentry. This enables remote error tracking and monitoring for script packs.
There are several script API modules in Bedrock Edition that are exclusive to certain platforms due to capability restrictions on different platforms. Here is a table of the features that are available only on certain platforms as of Minecraft release 1.21.90.
Modules | Client / Single-player | Bedrock Dedicated Server | Realms |
---|---|---|---|
@minecraft/common | Yes | Yes | Yes |
@minecraft/debug-utilities | Yes | Yes (Note 3) | No |
@minecraft/diagnostics | No | Yes (Note 3) | No |
@minecraft/server | Yes | Yes | Yes |
@minecraft/server-admin | Yes | Yes | Yes |
@minecraft/server-editor | Yes (Note 1) | Yes (Note 2) | Yes |
@minecraft/server-gametest | Yes | Yes | Yes |
@minecraft/server-net | No | Yes (Note 3) | No |
@minecraft/server-ui | Yes | Yes | Yes |
Notes:
bedrock_server.exe
to enable editor with the command line, like this:bedrock_server.exe Editor=true
Check out my add-ons if you want.
Script Interpreter - Run an interactive Script API interpreter from in-game.
Bedrock Statistics - Track in-game statistics like Java Edition.