RA-DiscordProfile
Author: RajaAditya Website: rajaaditya.my.id Version: 1.0.0 API: Paper 1.21.4 (Java 21)
Features
Profile Cards
/profile <player>in Discord returns a PNG profile card drawn by the plugin, with the player's skin, rank, join date, and chosen stats- Player names autocomplete in Discord
- Bedrock players get a Bedrock badge, and their avatar is fetched from the GeyserMC skin API
- Colors, size, font (
.ttf), and date format of the card are configurable
Leaderboards and Comparison
/leaderboard <category>shows the top 10 for a stat/compare <player1> <player2>compares every stat side by side
Your Own Stats
- Any PlaceholderAPI placeholder can become a stat, for example
%vault_eco_balance%,%racoins_balance%, or%statistic_seconds_played% - Stat formats:
number,decimal, ortime - Playtime can be tracked by the plugin itself (from join and quit plus the running session) instead of vanilla statistics
- Stats that cannot be read as a number are kept as text and left out of leaderboards
Built for Servers
- All players online are saved on an interval (default every 5 minutes) and when the server stops
- A cooldown per Discord user prevents spam
- Saving and every Discord or HTTP call run asynchronously. PlaceholderAPI, LuckPerms, and Floodgate are read only on the main thread
- Slash commands are registered per guild, so they appear immediately
Dependencies
| Plugin | Required | Purpose |
|---|---|---|
| PlaceholderAPI | Practically yes | Needed for placeholder-based stats, plus the expansions you use (for example /papi ecloud download Vault) |
| Vault | No (softdepend) | Money stat |
| LuckPerms | No (softdepend) | Rank on the card |
| Floodgate | No (softdepend) | Bedrock detection |
You also need a Discord bot. No privileged gateway intent is required.
Installation
1. Create the bot
- Open the Discord Developer Portal and create a New Application
- In Bot, reset the token and copy it into
bot.tokeninconfig.yml - In OAuth2, URL Generator, choose the scopes
botandapplications.commands, and the permissionsSend Messages,Embed Links,Attach Files, andUse Slash Commands - Open the generated URL and add the bot to your server
- Turn on Developer Mode in Discord, copy your server ID, and put it in
bot.guild-id
2. Install the plugin
- Place
RA-DiscordProfile.jarinto yourplugins/folder (JDA, HikariCP, and SQLite are bundled) - Restart the server, fill in
config.yml, and run/discordprofile reload
Keep the bot token private and never commit config.yml to a public repository.
File Structure
text
1
plugins/RA-DiscordProfile/
├── config.yml # Token, guild, cooldowns, card look, stats
├── messages.yml # All text: Discord replies, card labels, in-game messages
├── data.db # SQLite (WAL): snapshots and playtime
└── *.ttf # Optional card font
Configuration
config.yml
yaml
1
bot:
token: "YOUR_BOT_TOKEN"
guild-id: "YOUR_GUILD_ID"
activity:
type: PLAYING # PLAYING, WATCHING, LISTENING, COMPETING, CUSTOM_STATUS
text-key: "bot-activity" # key in messages.yml
status: ONLINE
shutdown-timeout-seconds: 10
settings:
bedrock-prefix: "." # same as username-prefix in Floodgate
autocomplete-max: 25
leaderboard-size: 10
command-cooldown-seconds: 5
snapshot-interval-minutes: 5
card:
width: 900
height: 400
accent-color: "#5865F2"
background-color: "#1E1F26"
panel-color: "#2A2C36"
text-color: "#FFFFFF"
muted-color: "#9CA3AF"
font-file: "" # .ttf in the plugin folder, empty = first one found
cache-minutes: 5
skin-cache-minutes: 30
skin-url: "https://mc-heads.net/body/{name}/right" # supports {uuid} and {name}
date-format: "dd MMM yyyy"
timezone: "Asia/Jakarta"
stats:
coins:
placeholder: "%racoins_balance%"
display: "Coins"
format: "number" # number, decimal, or time
leaderboard: true # show as a /leaderboard choice
playtime:
placeholder: "%statistic_seconds_played%"
display: "Playtime"
format: "time"
leaderboard: true
On offline-mode servers, use {name} in skin-url, because the UUID is not known to the skin service. For plugin-tracked playtime use source: internal with the key playtime.
After changing the stats list, run /discordprofile reload.
Commands
Discord
| Command | Description |
|---|---|
/profile <player> | Profile card as an image |
/leaderboard <category> | Top 10 of a stat |
/compare <player1> <player2> | Compare all stats of two players |
In game
| Command | Description | Access |
|---|---|---|
/discordprofile reload (alias /dprofile) | Reload the config, messages, and stats. The bot restarts only if the token or guild ID changed | Admin |
/discordprofile sync | Save every online player now | Admin |
Permissions
| Permission | Default | Description |
|---|---|---|
raprofile.admin | op | Use /discordprofile |
License
Developed by RajaAditya — rajaaditya.my.id