constmessageForm = newMessageFormData() .title("Message Form Example") .body("This shows a simple example using §o§7MessageFormData§r.") .button1("Button 1") .button2("Button 2");
messageForm .show(players[0]) .then((formData: MessageFormResponse) => { // player canceled the form, or another dialog was up and open. if (formData.canceled || formData.selection === undefined) { return; }
messageForm .show(players[0]) .then((formData: MessageFormResponse) => { // player canceled the form, or another dialog was up and open. if (formData.canceled || formData.selection === undefined) { return; }
Builds a simple two-button modal dialog.
示例: showBasicMessageForm.ts
示例: showTranslatedMessageForm.ts