ModsJava
NPDiscord
Link your Minecraft ↔ Discord accounts — Automatic roles, logs & synchronization
⬇ Download on HangarOpen in MCModsHubGet it on Google Play →# 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](https://modrinth.com/project/npplugincore)** + **LuckPerms** (for ranks)
---
## ✨ Features
### 🔗 Account Linking
- `/discord link
` — Player enters a code received via Discord DM
- `/discord create-link ` — 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., only `ERROR` and `WARN`)
- **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
1. **NorrionProjectPluginCore** (installed and working)
2. **LuckPerms** (for rank sync)
3. A **Discord bot** (token + Application ID)
### Steps
1. Download `NPDiscord-.jar` → `plugins/`
2. Restart the server
3. Configure `plugins/NorrionProject/discord/config.yml`
4. Restart again
5. Bot connects ✅
---
## ⚙️ Configuration (`config.yml`)
All documentation is provided in `plugins/NorrionProject/discord-config.yml`
### How to get Discord IDs?
1. Enable **Developer Mode**: Discord Settings → Advanced → Developer Mode
2. Right-click server/channel/role → **Copy ID**
---
## 🎮 Commands
| Command | Permission | Description |
|---------|--------------------|-------------|
| `/discord link ` | `nordiscord.link` | Link account (player) |
| `/discord create-link ` | `nordiscord.admin` | Create link message (staff) |
---
## 🔧 Discord Bot Setup
1. Go to [Discord Developer Portal](https://discord.com/developers/applications)
2. **New Application** → Name it (e.g. "MyServer Bot")
3. **Bot** tab → **Reset Token** → Copy token in config
4. Still **Bot** tab, enable:
- ✅ **Message Content Intent**
- ✅ **Server Members Intent**
- ✅ **Presence Intent**
5. **OAuth2** → **URL Generator**:
- Scopes: `bot`, `applications.commands`
- Permissions: `Send Messages`, `Embed Links`, `Manage Roles`, `Read Message History`, `Use Slash Commands`
6. Open generated URL in browser → Add bot to your server
7. 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](https://norrion.eu)
- **Support / Bugs**: [Norrion Discord](https://discord.gg/WHUZNQe)
---
*Plugin **NorrionProject** — Requires NorrionProjectPluginCore + LuckPerms*NPDiscord is a free Minecraft Java mod. Compatible with Minecraft 26.1, 26.1.1, 26.1.2. Downloaded 1 times (via Hangar). Download it and open it directly in the game.
Explore more