NPDiscord
Link your Minecraft ↔ Discord accounts — Automatic roles, logs & synchronization
🎯 What is this?
NPDiscord connects your Minecraft server to a Discord bot. Players link their in-game account to their Discord account for:
- 🎭 Automatic Discord roles based on their in-game LuckPerms rank
- 📋 Server logs in Discord (chat, joins, punishments, etc.)
- 🔗 Simple linking commands (
/discord link,/discord create-link)
Requires: NorrionProjectPluginCore + LuckPerms (for ranks)
✨ Features
🔗 Account Linking
/discord link <code>— Player enters a code received via Discord DM/discord create-link <channel-id>— Staff: generates a Discord message with "Link Account" button- Anti-duplicate protection (one MC account = one Discord account)
🎭 Role Sync (LuckPerms)
| LuckPerms Rank | → | Discord Role |
|---|---|---|
owner |
→ | 👑 Owner |
admin |
→ | 🛡️ Admin |
mod |
→ | ⚔️ Moderator |
vip |
→ | ✨ VIP |
player |
→ | 🎮 Player |
Fully configurable: you decide which rank = which Discord role.
📋 Discord Logs (Dedicated Channels)
Automatically send to Discord:
- 💬 Chat (global, local, staff)
- 🔌 Joins / Leaves
- ⚠️ Punishments (ban, mute, kick, warn)
- 🎒 Economy (earnings, spending, payments)
- 📦 Items (drop, craft, enchant)
- 🏗️ Blocks (place, break, explode)
Each log type = a configurable Discord channel (or disabled).
📊 Server Monitoring (Log4j2 → Discord)
Real-time server log forwarding to a Discord channel via a custom Log4j2 appender.
What it captures:
- All log levels you configure:
TRACE,DEBUG,INFO,WARN,ERROR,FATAL - Full log context: timestamp, level, logger name, thread, message
- Stack traces for exceptions (automatically included)
- Colored embeds by severity: 🔴 ERROR/FAIL, 🟡 WARN, 🔵 INFO, ⚫ FATAL, ⚪ DEBUG/TRACE
Smart filtering:
- Startup suppression (
monitoringAfterServerDone: true) — ignores spammy startup logs until server is fully ready - Level whitelist (
enabledLogLevels) — only send what you care about (e.g., onlyERRORandWARN) - Async sending — non-blocking, won't lag the server
Use cases:
- 🔔 Get pinged on Discord when ERROR/FATAL appears
- 📈 Watch for plugin errors, crashes, or exploits in real-time
- 🔍 Debug production issues without SSH/tail access
📦 Installation
Prerequisites
- NorrionProjectPluginCore (installed and working)
- LuckPerms (for rank sync)
- A Discord bot (token + Application ID)
Steps
- Download
NPDiscord-<version>.jar→plugins/ - Restart the server
- Configure
plugins/NorrionProject/discord/config.yml - Restart again
- Bot connects ✅
⚙️ Configuration (config.yml)
All documentation is provided in plugins/NorrionProject/discord-config.yml
How to get Discord IDs?
- Enable Developer Mode: Discord Settings → Advanced → Developer Mode
- Right-click server/channel/role → Copy ID
🎮 Commands
| Command | Permission | Description |
|---|---|---|
/discord link <code> |
nordiscord.link |
Link account (player) |
/discord create-link <channel-id> |
nordiscord.admin |
Create link message (staff) |
🔧 Discord Bot Setup
- Go to Discord Developer Portal
- New Application → Name it (e.g. "MyServer Bot")
- Bot tab → Reset Token → Copy token in config
- Still Bot tab, enable:
- ✅ Message Content Intent
- ✅ Server Members Intent
- ✅ Presence Intent
- OAuth2 → URL Generator:
- Scopes:
bot,applications.commands - Permissions:
Send Messages,Embed Links,Manage Roles,Read Message History,Use Slash Commands
- Scopes:
- Open generated URL in browser → Add bot to your server
- Copy Application ID (General Information tab) in config
❓ FAQ
Q: Bot won't connect?
A: Check token, Intents (Message Content, Server Members, Presence), and that bot is on the server.
Q: Roles not syncing?
A: Verify guild-id (Discord server ID), bot has Manage Roles permission, and bot's role is above the roles it assigns in Discord hierarchy.
Q: A player lost their link?
A: Delete their entry in plugins/NorrionProject/discord/data/ (YAML file per UUID) or use DB if enabled.
Q: Does it work without LuckPerms?
A: Role sync requires LuckPerms. Linking and logs work without it.
🔗 Useful Links
- Website & Wiki: norrion.eu
- Support / Bugs: Norrion Discord
Plugin NorrionProject — Requires NorrionProjectPluginCore + LuckPerms