@minecraft/server-ui
Module
The @minecraft/server-ui
module contains types for expressing simple dialog-based user experiences.
@minecraft/server-ui.ActionFormData contain a list of buttons with captions and images that can be used for presenting a set of options to a player.
@minecraft/server-ui.MessageFormData are simple two-button message experiences that are functional for Yes/No or OK/Cancel questions.
@minecraft/server-ui.ModalFormData allow for a more flexible "questionnaire-style" list of controls that can be used to take input.
Changelog
Examples
createActionForm.js
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!");
}
});
Manifest Details
{
"module_name": "@minecraft/server-ui",
"version": "1.1.0"
}
Available Versions
1.2.0-beta
1.1.0
1.0.0
0.1.0
Enumerations
Classes
- ActionFormData
- ActionFormResponse
- FormResponse
- MessageFormData
- MessageFormResponse
- ModalFormData
- ModalFormResponse
- UIManager
Errors
Objects
uiManager
static read-only uiManager: UIManager;
Type: UIManager
Caution
This property is still in pre-release. Its signature may change or it may be removed in future releases.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for