Skip to main content

Placeholders

XDiscordUltimate registers a PlaceholderAPI expansion with the identifier xdiscord. Any plugin or script that resolves PlaceholderAPI placeholders can read Discord link state and guild info from it.
PlaceholderAPI is an optional soft-dependency. These placeholders only resolve when PlaceholderAPI is installed alongside XDiscordUltimate. The plugin auto-registers its expansion on enable when it detects PlaceholderAPI.

Player Placeholders

These require a Player or OfflinePlayer context. For unlinked players, text placeholders return "Not Linked" and ID-style placeholders return "N/A".
PlaceholderDescriptionExample output
%xdiscord_verified%Whether the player is linkedtrue / false
%xdiscord_linked%Human-readable link statusYes / No
%xdiscord_discord_name%Discord display nameDiscordUser / Not Linked
%xdiscord_discord_id%Discord snowflake123456789012345678 / N/A
%xdiscord_discord_tag%Discord name with discriminatorDiscordUser#0001 / Not Linked
%xdiscord_discord_avatar%Avatar URLhttps://cdn.discordapp.com/... / (empty)
%xdiscord_has_nitro%Whether the member is boostingtrue / false
%xdiscord_is_booster%Alias of has_nitrotrue / false

Server Placeholders

These do not require a player and resolve against the configured main guild:
PlaceholderDescriptionExample output
%xdiscord_bot_status%Bot connection stateOnline / Offline
%xdiscord_guild_name%Main guild nameMy Server / N/A
%xdiscord_guild_members%Total member count428 / 0
%xdiscord_guild_online%Online members (online/idle/dnd)57 / 0

Usage

In chat formats, scoreboards, TAB plugins, or anywhere PlaceholderAPI is expanded:
%xdiscord_linked%
%xdiscord_discord_name%
%xdiscord_is_booster%
%xdiscord_guild_members%
From Java, if you depend on PlaceholderAPI directly:
import me.clip.placeholderapi.PlaceholderAPI;

String linked  = PlaceholderAPI.setPlaceholders(player, "%xdiscord_linked%");
String members = PlaceholderAPI.setPlaceholders(null, "%xdiscord_guild_members%");
Or use XDiscordUltimate’s reflection-safe helper, which is a no-op when PlaceholderAPI is absent:
String text = XDiscordUltimate.getInstance()
    .parsePlaceholders("%xdiscord_discord_name%", player);
Player placeholders perform a short (1-second) async lookup against the database and Discord API. They are safe for periodic refresh but avoid hammering them on every tick. For high-frequency reads inside your own plugin, call DatabaseManager.getDiscordId directly and cache the result.

Next Steps

API Overview

Start here for the singleton, services, and setup.

Community Features

See how verification, tickets, and reports surface to players.