Skip to main content

API Overview

The XDiscordUltimate API exposes the plugin’s core services — database, events, modules, Discord bot, and optional hooks — so your plugin can read linked-account state, react to verification, and integrate with the running Discord guild.

Getting Started

Dependency

XDiscordUltimate is published via JitPack. Add it as a provided/compileOnly dependency — the plugin ships the implementation at runtime. Gradle:
repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    compileOnly 'com.github.xreatlabs:XDiscordUltimate:1.2.0'
}
Maven:
<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>com.github.xreatlabs</groupId>
        <artifactId>XDiscordUltimate</artifactId>
        <version>1.2.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Basic Usage

XDiscordUltimate is a singleton. Grab it with XDiscordUltimate.getInstance(), null-check it, then reach for the services you need.
import com.xreatlabs.xdiscordultimate.XDiscordUltimate;
import org.bukkit.plugin.java.JavaPlugin;

public class MyPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        XDiscordUltimate xdiscord = XDiscordUltimate.getInstance();

        if (xdiscord == null) {
            getLogger().warning("XDiscordUltimate not loaded — disabling integration.");
            return;
        }

        // Services are ready. Access them from here.
        getLogger().info("Hooked into XDiscordUltimate "
            + xdiscord.getDescription().getVersion());
    }
}
Declare XDiscordUltimate as a depend or softdepend in your plugin.yml so it loads before your plugin. Without it, getInstance() may return null during onEnable.

Core Services

All services hang off the main class via getters:
GetterReturnsPurpose
getConfigManager()ConfigManagerTyped access to plugin configuration
getMessageManager()MessageManagerLocalized message strings
getDatabaseManager()DatabaseManagerLink state, tickets, moderation, stats
getModuleManager()ModuleManagerChat bridge, logging, and other modules
getDiscordManager()DiscordManagerThe running JDA bot and main guild
getEmbedUtils()EmbedUtilsDiscord embed builders
getAdminUtils()AdminUtilsAdministrative helpers
getLuckPerms()Object (nullable)LuckPerms provider, if present
isLuckPermsEnabled()booleanWhether LuckPerms was hooked
isPlaceholderAPIEnabled()booleanWhether PlaceholderAPI was hooked
parsePlaceholders(String, Player)StringResolve PAPI placeholders in a string
getStartTime()longPlugin enable time (epoch ms)
XDiscordUltimate xdiscord = XDiscordUltimate.getInstance();

DatabaseManager db   = xdiscord.getDatabaseManager();
DiscordManager discord = xdiscord.getDiscordManager();
boolean hasPapi = xdiscord.isPlaceholderAPIEnabled();

Worked Example: Is a Player Linked?

The most common integration question is “is this Minecraft account linked to Discord?” The DatabaseManager offers two paths:

Best Practices

Next Steps

Database API

Link state, tickets, moderation, stats, and raw SQL access.

Event Bus

Listen for PlayerVerifiedEvent and publish your own events.

Placeholders

Expose Discord data to any PlaceholderAPI-compatible plugin.