PaperMC - ProjectUnified/UniDialog GitHub Wiki

Add dependency

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

Basic Usage

Create a Dialog Manager

Create a PaperDialogManager like this:

PaperDialogManager dialogManager = new SpigotDialogManager(plugin);

Register the Dialog Manager

Simply call the register method

dialogManager.register()

Create a Dialog

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();

Open the Dialog

UUID playerUUID;
dialogOpener.open(playerUUID);

Known limitation

  • clearDialog is not supported
⚠️ **GitHub.com Fallback** ⚠️