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; }
Returns data about the player results from a modal message form.
Example: showBasicMessageForm.ts
Example: showTranslatedMessageForm.ts