-
Notifications
You must be signed in to change notification settings - Fork 0
Custom Commands
The custom command system lets you define your own Discord slash commands that respond with text, embeds, and live Minecraft data — all through YAML configuration, no coding required.
In discord-custom-commands.yml:
custom-commands:
enabled: trueEach custom command is a separate YAML file inside plugins/uxmDiscordSync/discord-commands/:
discord-commands/
├── ip.yml
├── profile.yml
├── stats.yml
├── balance.yml
├── store.yml
└── mycommand.yml # Your custom command
The plugin loads all .yml files in this folder automatically. Add a new file and run /uxmdiscordsync reload to register it.
# The Discord slash command name (lowercase, no spaces)
name: "ip"
# The description shown in the Discord command picker
description: "Get the server IP address"
# Whether the response is visible only to the user who ran it
ephemeral: false
# Optional: cooldown in seconds between uses per user
cooldown: 10
# Optional: only allow in specific channels (by ID). Empty = all channels.
allowed-channels: []
# Optional: only allow users with specific Discord roles (by ID). Empty = all roles.
required-roles: []
# The response to send
response:
type: embed # "embed" or "text"
embed:
title: "Server IP"
description: "Connect using: **play.yourserver.com**"
color: "#5865F2"
fields:
- name: "Java Edition"
value: "play.yourserver.com:25565"
inline: true
- name: "Bedrock Edition"
value: "play.yourserver.com:19132"
inline: true
footer:
text: "See you online!"response:
type: text
content: "The server IP is **play.yourserver.com**"response:
type: embed
embed:
title: "Title here"
description: "Description here. Supports **markdown**."
color: "#FF0000"
thumbnail: "https://example.com/image.png"
image: "https://example.com/banner.png"
fields:
- name: "Field Name"
value: "Field Value"
inline: true
footer:
text: "Footer text"
icon-url: ""
author:
name: "Author Name"
url: ""
icon-url: ""Placeholders are replaced in both text and embed content. They pull live data from the Minecraft server.
| Placeholder | Description | Example |
|---|---|---|
%server_name% |
Server name from config | Survival |
%online_players% |
Current online players | 42 |
%max_players% |
Max player slots | 100 |
%server_tps% |
Current TPS | 19.98 |
%server_uptime% |
Server uptime | 3h 12m |
%server_ram_used% |
RAM in use (MB) | 2048 |
%server_ram_max% |
Max RAM (MB) | 8192 |
| Placeholder | Description |
|---|---|
%total_boosts% |
Number of Discord server boosts |
%linked_accounts% |
Total number of linked accounts |
%member_count% |
Total Discord member count |
These require the user to have a linked account and be online on the Minecraft server. They are available when a command targets a specific player.
| Placeholder | Description |
|---|---|
%player_name% |
Minecraft username |
%player_uuid% |
Minecraft UUID |
%player_level% |
XP level |
%player_health% |
Current health |
%player_food_level% |
Current hunger |
%player_exp% |
Experience points |
%player_world% |
Current world |
%player_x% |
X coordinate |
%player_y% |
Y coordinate |
%player_z% |
Z coordinate |
Requires Vault and an economy plugin:
| Placeholder | Description |
|---|---|
%vault_eco_balance% |
Player balance (raw number) |
%vault_eco_balance_formatted% |
Player balance (formatted string) |
If PlaceholderAPI is installed, any %statistic_*% and third-party PAPI placeholders work inside custom command responses.
The plugin ships with these example commands in the discord-commands/ folder. Edit or delete them freely.
Returns the server's connection IP.
Shows a player's Minecraft profile with stats pulled from a linked account.
name: "profile"
description: "View a player's profile"
options:
- name: "player"
description: "Minecraft username or @Discord user"
type: string
required: falseShows a live server stats embed using server placeholders.
Shows a player's in-game economy balance. Requires Vault.
Returns a link or embed for your server's webstore.
Custom commands can accept user input via slash command options:
options:
- name: "player"
description: "The player to look up"
type: string # string | integer | boolean | user | channel | role
required: falseThe value of an option can be used in the response:
response:
type: text
content: "Looking up player: %option_player%"allowed-channels:
- "CHANNEL_ID_1"
- "CHANNEL_ID_2"Attempts in other channels get an ephemeral "This command is not available here" error.
required-roles:
- "ROLE_ID"Users without one of the listed roles receive an ephemeral permission error.
cooldown: 30 # Seconds between uses per userAfter adding or editing command files:
/uxmdiscordsync reload
New slash commands are registered with Discord. Note: Discord can take up to an hour to propagate newly registered slash commands to all clients globally. For instant testing, set the command as guild-specific in your bot settings.
⚙️ Setup
🔗 Core Systems
✨ Features
📋 Logging
💬 Commands
🔧 Advanced