mojang-minecraft-ui
v1.1.9
Published
Minecraft UI for Minecraft Bedrock Edition API
Downloads
57
Maintainers
Readme
mojang-minecraft-ui Module
View mojang-minecraft-ui wiki website click here
In this article
The mojang-minecraft-ui
module contains types for expressing simple
dialog-based user experiences.
- ActionForms contain a list of buttons with captions and images that can be used for presenting a set of options to a player.
- MessageForms are simple two-button message experiences that are functional for Yes/No or OK/Cancel questions.
- ModalForms allow for a more flexible "questionnaire-style" list of controls that can be used to take input.
These APIs are expressed as "builder style" to allow you to create quick forms in code. For example, this code creates an action button form:
const form = new ActionFormData()
.title("Months")
.body("Choose your favorite month!")
.button("January")
.button("February")
.button("March")
.button("April")
.button("May");
form.show(players[0]).then((response) => {
if (response.selection === 3) {
dimension.runCommand("say I like April too!");
}
});
NOTE: A dependency reference to this module must be declared within the
manifest.json
file of your behavior pack. The module identifier UUID
is 2BD50A27-AB5F-4F40-A596-3641627C635E
.
For example:
"dependencies": [
{
"uuid": "b26a4d4c-afdf-4690-88f8-931846312678",
"version": [ 0, 1, 0 ]
},
{
"uuid": "6f4b6893-1bb6-42fd-b458-7fa3d0c89616",
"version": [ 0, 1, 0 ]
},
{
"uuid": "2BD50A27-AB5F-4F40-A596-3641627C635E",
"version": [ 0, 1, 0 ]
}
]