The landing page for Minecraft Bedrock Script API Reference contains documentation related to experimental and stable Minecraft Script APIs that interact with a Minecraft world programmatically.
Visit one of the following links to view the full documentation that matches your Minecraft version.
Minecraft: Bedrock Edition API references: Script API - Latest
Minecraft: Bedrock Edition Preview API references: Script API - Preview
The Minecraft module, or the @minecraft/server
module, is the main script module to manipulate a Minecraft world, including entities, blocks, dimensions, and more. Here are some features that you can integrate with a script plugin.
A script plugin can customize the experience of gameplay in Minecraft, through accessing and modifying the state of a Minecraft world. From changing weather and game rules for an in-game world to modifying a player's attributes.
Explore the World
class to see all the features you can manipulate within the world.
The Script API can receive events sent by Minecraft to script plugins. An event represents something that is happening inside of a Minecraft world, like a player interacting with an entity. They can be used to create more engaging experiences for players.
Minecraft Script API's events are broken down into the following categories:
The API offers some control over components of an entity, a block, or an item. This includes modifying an inventory container, and player attributes.
A behavior pack can also use Custom Components on blocks and items to create an immersive experience for players. Script plugins can create their functionality across specific blocks and items.
The Minecraft module also provides mechanisms for script plugins to store data. The data are stored in a Minecraft world in key/value pairs.
The two mechanisms within Minecraft world storage (accessible through Script API) are as follows:
There are a lot of features available in that script module for you to explore. You should probably start making your app.
The @minecraft/server-ui
module helps you build simple forms or dialogs, and send them to players. This allows script plugins to collect form-like data in Minecraft.
A form with a list of buttons with captions and images for presenting a set of options to a player.
A form with two-button that are functional for Yes/No or OK/Cancel questions.
A more flexible "questionnaire-style" list of controls in a form that can be used to take input.
One of the sample GameTests from Microsoft's sample GameTest repository on GitHub
GameTest Framework is a toolset available to creators to build and test any new content using the @minecraft/server-gametest
script module and the /gametest
command in Minecraft. Each GameTest is broken into the following:
Bedrock Editor with Editor Samples Add-On in Minecraft Preview v1.21.30 (August 2024)
The Minecraft Editor or the @minecraft/server-editor
module is a built-in JavaScript library for Editor extensions to build complex tools to build, edit, and test worlds. Currently, this API is only accessible in Bedrock Preview on Windows.
An Editor extension is a set of resource pack and behavior packs, like .mcaddon
files but for Editor, uses this API to perform most actions in the Bedrock Editor.
Here are some examples of what you can achieve with the Extension API:
The @minecraft/server-net
module in Minecraft Bedrock's Script API allows for server-based HTTP request handling and packet handling specifically within a Bedrock Dedicated Server.
The @minecraft/server-admin
module manages the administration in a Bedrock Dedicated Server. Its current capabilities include:
A Script API module that is used for debugging purposes. Currently features: