-
Notifications
You must be signed in to change notification settings - Fork 7
Creating and handling ModalForm
Andrew Terentev edited this page Sep 10, 2021
·
2 revisions
ModalForm intended for getting the modal response. Response can be positive or negative.
Modal form has 4 elements:
- Title
- Text
- Positive button
- Negative button
new ModalForm("Test modal form", "This is a text.")
.setPositiveButton("Positive button")
.setNegativeButton("Negative button")
.setHandler((p, result) -> {
// Player p
// boolean result
p.sendMessage("Taken " + (result? "positive" : "negative") + " response.");
}).send(player);
Note: If you didn't set buttons text then they will be empty.