Files
FancyPlugins/docs/src/fancydialogs/api/getting-started.md
2025-06-21 12:57:58 +02:00

1.6 KiB

icon
icon
dot

Getting started

Include the API in your project

To include the FancyNPCs API in your project, you need to add the following dependency to your build.gradle.kts or pom.xml file.

Gradle:

repositories {
    maven("https://repo.fancyinnovations.com/releases")
}
dependencies {
    compileOnly("de.oliver:FancyDialogs:VERSION")
}

Maven:

<repository>
    <id>fancyinnovations-releases</id>
    <name>FancyInnovations Repository</name>
    <url>https://repo.fancyinnovations.com/releases</url>
</repository>
<dependency>
    <groupId>de.oliver</groupId>
    <artifactId>FancyDialogs</artifactId>
    <version>VERSION</version>
    <scope>provided</scope>
</dependency>

Replace VERSION with the version of the API you want to use. You can find the latest version on the download pages or in the GitHub releases.

Show a notice dialog

new NoticeDialog("title", "message").show(player);
// or
NoticeDialog.show(player, "message");

Show a confirmation dialog

new ConfirmationDialog("Are you sure you want to reload the configuration?")
    .withTitle("Confirm reload")
    .withOnConfirm(() -> player.sendMessage("Reloading configuration..."))
    .withOnCancel(() -> player.sendMessage("Reload cancelled."))
    .ask(player);

JavaDocs and help

You can find the JavaDocs for the FancyDialogs API here.

Join the FancyInnovations Discord for help and support. There is a dedicated channel for help about the api (#dialogs-api).