PaperMC - ProjectUnified/UniDialog GitHub Wiki
Add io.github.projectunified:uni-dialog-paper
to your build tools
For example, here is the dependency for Maven:
<dependency>
<groupId>io.github.projectunified</groupId>
<artifactId>uni-dialog-paper</artifactId>
<version>VERSION</version>
</dependency>
Check here for more information on other build tools
Check here for the JavaDoc
Create a PaperDialogManager like this:
PaperDialogManager dialogManager = new SpigotDialogManager(plugin);
Simply call the register
method
dialogManager.register()
The preferred way is to construct a Dialog and call its opener
to get the DialogOpener
. The DialogOpener
is preserved and used to open the dialog for the player.
DialogOpener dialogOpener = dialogManager.createConfirmationDialog()
.title("Sample Dialog")
.canCloseWithEscape(true)
.afterAction(Dialog.AfterAction.CLOSE)
.body(builder -> builder.text().text("This is a sample dialog. Do you want to proceed?"))
.input("name", builder -> builder.textInput().label("Enter your name:"))
.yesAction(builder -> builder.label("Confirm"))
.noAction(builder -> builder.label("Cancel"))
.opener();
UUID playerUUID;
dialogOpener.open(playerUUID);
-
clearDialog
is not supported