Special Thanks
Special thanks to Trixy for being the first test people and also for being there along the way. Also thanks to Vixbe for also putting up with it.
I am owner of the site files besides images on Trixy's card.
WebsiteLinker Plugin Guide v1.1.4
A simple Paper Minecraft plugin that sends server events (like player joins, chats, deaths) to Discord and a website API. It also runs a local status server for polling and sends periodic updates (player count, uptime, MOTD) every 30 seconds to the website.
This guide is step-by-step for setup, config, commands, and integration. No sensitive info (tokens, URLs) includedâreplace placeholders like [YOUR_TOKEN] with your own. Tested on Paper 1.21 dont be mad at me if it doesn't work for your server get help on my Discord.
1. Development Tools Used
- Coding: Visual Studio Code (free editor from Microsoft) with Java extensions (Language Support for Java by Red Hat, Maven for Java).
- Website API Hosting: Render.com (free tier for Node.js apps)
- Website Hosting: InfinityFree.com (free PHP hosting).
- Discord Bot Invite: Use https://scarsz.me/authorize with your bot's Application ID (after creating bot in Discord Developer Portal). Always set bot to private (unset public), remove install link, then use the authorize URL to add to your server.
2. Server Installation (Minecraft Side)
For self-hosted servers:
- Download PaperMC 1.21 (recommended for performance).
Go to https://papermc.io/downloads/paper
Download the latest 1.21 JAR (e.g., paper-1.21-xxx.jar).
Create a folder for your server (e.g., C:\MinecraftServer).
Put the Paper JAR there, run it once:java -Xmx2G -jar paper-1.21-xxx.jar nogui
Accept EULA (edit eula.txt to eula=true).
Edit server.properties: online-mode=true (or false for cracked), motd=Your Server MOTD. - Install the Plugin.
Download WebsiteLinker-x.x.x.jar (replace x.x.x with the current version, e.g., 1.1.4).
For self-hosted: Copy WebsiteLinker-x.x.x.jar to your server's plugins/ folder.
For hosted: Upload WebsiteLinker-x.x.x.jar via the hosting panel to the plugins/ folder.
Restart the server. Console should show:
[WebsiteLinker] Enabling WebsiteLinker v1.1.4 [WebsiteLinker] WebsiteLinker enabled! Made by ThePurpleFox [WebsiteLinker] Configuration loaded.
If errors, check console/logs. Common fix: Ensure Java 21 (server.properties or startup script: java -Xmx2G -jar paper.jar nogui). - Basic Config.
The config.yml is auto-generated in plugins/WebsiteLinker/. See the Configuration section for details on editing it. After editing, run /wl reload in-game (or restart server). - Test Basic Features.
Join server: Should send "join" event to Discord/website if enabled.
Chat: Type messageâsends "chat" if enabled.
Die: /killâsends "death".
Stop server: Sends "stop" event.
Periodic: If website.periodic-status: true, check API for "status" every 30s (online_players, uptime, motd).
Local Status: Visit http://localhost:8080/events (or ngrok for public) for JSON: {"online":X,"uptime":"...","motd":"...","recent_events":[...]}
Or, if using a hosting service (e.g., Exaroton, Aternos, Minehut):
Follow the hosting provider's instructions to create a Paper 1.21 server.
Note: This plugin was tested on Exaroton hosting for plugin compatibility.
3. Configuration
The config.yml is located in plugins/WebsiteLinker/config.yml and is auto-generated on first run. Edit it to customize the plugin behavior. Below is the full example configuration with explanations.
enabled:
discord: true # Enable Discord sends
website: true # Enable website API sends
status-server: true # Local HTTP server on port 8080 for polling
discord-to-mc: false # Relay Discord messages to MC chat (optional)
relay: false # Heartbeat/status relay from Discord to MC
discord:
events: # Which events to send to Discord
join: true
quit: true
chat: true
start: true
stop: true
advancement: true
death: true
token: [YOUR_BOT_TOKEN] # From Discord Developer Portal > Bot > Token
channel: [CHANNEL_ID] # Discord channel ID (right-click channel > Copy ID, enable Developer Mode)
live-channel: [LIVE_CHANNEL_ID] # For live embed updates (optional)
relay-channel: [RELAY_CHANNEL_ID] # For status requests from Discord (optional)
live-embed:
features:
players: true # Show online players in embed
uptime: true # Show server uptime
motd: true # Show MOTD
chat-embed: true # Embed chat messages
website:
events: # Which events to send to API
join: true
quit: true
chat: true
start: true
stop: true
advancement: true
death: true
url: https://api.example.com/api/events # Your API endpoint (POST JSON)
api-key: [YOUR_API_KEY] # Optional Bearer token for auth
periodic-status: true # Send status every 30s
status-interval: 30 # Seconds between status updates (min 10)
status-server:
enabled: true
port: 8080 # Local port for /events JSON polling (avoid 25565)
After editing, use /wl reload to apply changes without restarting the server.
4. Commands and Permissions
Permissions
websitelinker.admin(default: ops): Access to all commands and GUI.websitelinker.use(default: true): Basic GUI access (if extended).
Main Command
/websitelinker or /wl (alias)
Usage
/wl <subcommand> [args]
Subcommands
toggle-discord
Description: Toggles the Discord integration on/off.
Usage: /wl toggle-discord
Effect: If enabled and token set, starts/restarts the bot asynchronously. If disabled, shuts down the bot.
Feedback: "Discord toggled ON/OFF."
Permission: websitelinker.admin
toggle-discord-join
Description: Toggles sending player join events to Discord (independent of global Discord toggle).
Usage: /wl toggle-discord-join
Effect: Immediate; requires Discord enabled.
Feedback: "Discord join events toggled ON/OFF."
Permission: websitelinker.admin
toggle-discord-quit
Description: Toggles sending player quit events to Discord.
Usage: /wl toggle-discord-quit
Effect: Immediate; requires Discord enabled.
Feedback: "Discord quit events toggled ON/OFF."
Permission: websitelinker.admin
toggle-discord-chat
Description: Toggles sending player chat messages to Discord (MC to Discord).
Usage: /wl toggle-discord-chat
Effect: Immediate; requires Discord enabled.
Feedback: "MC chat to Discord toggled ON/OFF."
Permission: websitelinker.admin
toggle-discord-to-mc
Description: Toggles relaying all Discord channel messages to MC chat (separate from MC to Discord chat).
Usage: /wl toggle-discord-to-mc
Effect: Immediate; non-bot messages appear as "[Discord] User: message".
Feedback: "Discord to MC relay toggled ON/OFF."
Permission: websitelinker.admin
toggle-website
Description: Toggles the website POST integration on/off (affects all website events).
Usage: /wl toggle-website
Effect: Immediate toggle for sending events to the website endpoint.
Feedback: "Website POST toggled ON/OFF."
Permission: websitelinker.admin
toggle-status-server
Description: Toggles the status server for ngrok polling on/off.
Usage: /wl toggle-status-server
Effect: Updates config; restart plugin/server to apply (starts local HTTP on status-port).
Feedback: "Status server toggled ON/OFF. Restart plugin to apply."
Permission: websitelinker.admin
toggle-website-join
Description: Toggles sending player join events to website (independent of global website toggle).
Usage: /wl toggle-website-join
Effect: Immediate; requires website enabled.
Feedback: "Website join events toggled ON/OFF."
Permission: websitelinker.admin
toggle-website-quit
Description: Toggles sending player quit events to website.
Usage: /wl toggle-website-quit
Effect: Immediate; requires website enabled.
Feedback: "Website quit events toggled ON/OFF."
Permission: websitelinker.admin
toggle-website-chat
Description: Toggles sending player chat messages to website.
Usage: /wl toggle-website-chat
Effect: Immediate; requires website enabled.
Feedback: "Website chat events toggled ON/OFF."
Permission: websitelinker.admin
set-channel <channel-id>
Description: Sets the Discord channel ID without restarting the server.
Usage: /wl set-channel <channel-id>
- Example: /wl set-channel 123456789012345678
Effect: Updates config and switches channel if bot is running.
Tip: Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode), right-click channel > Copy ID.
Feedback: "Channel set to <id>."
Permission: websitelinker.admin
gui
Description: Opens an interactive GUI for quick toggles and reload (players only).
Usage: /wl gui
GUI Layout (3x9 inventory):
- Row 1: Slot 10 - Discord Integration (global, blue). Slot 11 - Discord to MC Relay (aqua). Slot 12 - Website POST (green). Slot 13 - Status Server (yellow).
- Row 2: Slots 14-16 - Discord Join/Quit/Chat Events (blue). Slots 19-21 - Website Join/Quit/Chat Events (dark green).
- Row 3: Slot 22 - Live Embed (purple). Slot 23 - Reload Config (red).
Behavior: Clicks cancel other interactions. GUI refreshes after actions. Chat feedback on toggles.
Permission: websitelinker.admin (or websitelinker.use for view-only if implemented).
reload
Description: Reloads config.yml and applies changes (toggles, URLs, tokens, etc.).
Usage: /wl reload
Effect: Bot reconnects if needed. Event toggles update immediately. Status server requires restart.
Feedback: "Config reloaded."
Permission: websitelinker.admin
No Arguments
Usage: /wl
Effect: Shows command list and version.
Output:
WebsiteLinker v1.1.4 - Made by ThePurpleFox
Commands:
/wl toggle-discord - Toggle Discord
/wl toggle-website - Toggle Website POST
/wl toggle-status-server - Toggle Status Server
/wl set-channel <id> - Set Discord channel
/wl gui - Open GUI
/wl reload - Reload config
Tab Completion
The plugin supports tab completion for subcommands (e.g., typing /wl t + Tab shows toggle-discord, toggle-website, toggle-status-server).
For set-channel, no args completion (manual ID input).
5. Website API Setup (Receive Events)
The plugin sends POST JSON to your URL: {"event":"join","data":"PlayerName","server":"MOTD","timestamp":1234567890}. Handle in endpoint, save to file/DB, update dashboard.
Option 1: Node.js on Render.com (Free, easy deploy).
- Create folder (e.g., api-folder), open in VS Code.
- Run
npm init -y, thennpm install express body-parser cors fs. - Create server.js (root code belowâno tokens):
- Create public/index.html (dashboardâfetches /api/events, shows events list/table).
- Create .env: PORT=3000 (optional).
- Deploy to Render: New Web Service > Connect GitHub repo > Build: npm install, Start: node server.js.
- Set plugin config website.url: https://api.example.com/api/events (test with
curl -X POST -H "Content-Type: application/json" -d '{"event":"test"}' [URL]).
const express = require('express');
const bodyParser = require('body-parser');
const cors = require('cors');
const fs = require('fs');
const path = require('path');
const app = express();
const PORT = process.env.PORT || 3000;
const DATA_FILE = path.join(__dirname, 'data/events.json');
app.use(cors());
app.use(bodyParser.json());
// POST /api/events - Receive plugin events
app.post('/api/events', (req, res) => {
const event = req.body;
if (!event.event || !event.timestamp) {
return res.status(400).json({error: 'Invalid event'});
}
// Optional auth: if (req.headers.authorization !== 'Bearer [YOUR_KEY]') return res.status(401).json({error: 'Unauthorized'});
let events = [];
if (fs.existsSync(DATA_FILE)) {
events = JSON.parse(fs.readFileSync(DATA_FILE, 'utf8'));
}
events.push(event);
if (events.length > 1000) events = events.slice(-500); // Limit storage
fs.writeFileSync(DATA_FILE, JSON.stringify(events, null, 2));
console.log(`Received event: ${event.event}`);
res.json({success: true, message: 'Event received'});
});
// GET /api/events - Fetch all events (for dashboard)
app.get('/api/events', (req, res) => {
if (fs.existsSync(DATA_FILE)) {
const events = JSON.parse(fs.readFileSync(DATA_FILE, 'utf8'));
res.json(events);
} else {
res.json([]);
}
});
// GET / - Simple status page
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, 'public/index.html'));
});
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});
Option 2: Use GitHub Codespaces (Free for development/testing).
- Create a new repository on GitHub for your API.
- Enable Codespaces in the repo settings.
- Open Codespaces, set up your Node.js API code (use the example above).
- Run locally in Codespaces for testing (forward ports for external access).
- For production, deploy to a host (see Option 1 or 3). Use Codespaces URL for temporary testing: Set plugin config website.url to the forwarded port URL (e.g., https://your-codespace-1234.preview.app.github.dev/api/events).
Option 3: Custom Setup on Paid Host, VPS, or Local Server.
- Choose a host (e.g., DigitalOcean VPS, AWS EC2, or local machine with public IP/domain).
- Install Node.js runtime.
- Deploy your API code (use examples from Option 1 or 2).
- Configure domain/SSL (e.g., via Let's Encrypt) and firewall for port 80/443.
- Set plugin config website.url: https://your-custom-domain.com/api/events.
- Note: Requires server management knowledge; ideal for full control.
For the Website Dashboard (Display Events):
Use InfinityFree.com (free PHP hosting) for a simple dashboard that fetches from your API.
Upload status.php (example below) to display events, status, and chats.
Example status.php code (fetches from API, shows tableâadapt to your API URL):
<?php
$apiUrl = 'https://api.example.com/api/events'; // Your API endpoint
$events = json_decode(file_get_contents($apiUrl), true) ?? [];
?>
<!DOCTYPE html>
<html><head><title>Server Events</title></head><body>
<h1>Minecraft Server Events</h1>
<table border="1">
<tr><th>Event</th><th>Data</th><th>Server</th><th>Time</th></tr>
<?php foreach (array_slice($events, -20) as $event): ?>
<tr><td><?= htmlspecialchars($event['event'] ?? '') ?></td>
<td><?= htmlspecialchars($event['data'] ?? '') ?></td>
<td><?= htmlspecialchars($event['server'] ?? '') ?></td>
<td><?= date('Y-m-d H:i:s', $event['timestamp'] ?? 0) ?></td></tr>
<?php endforeach; ?>
</table>
<script>setTimeout(() => location.reload(), 30000);</script> <!-- Auto-refresh 30s -->
</body></html>
For Periodic Status: In dashboard, fetch /api/events, filter "status" events for live player count/uptime/MOTD. Auto-refresh every 30s.
See the website side in action: FoxCraft Server Dashboard. I am the admin of the Minecraft server and the owner of the site and files on this page.
6. Discord Setup (Basicâno external bot yet)
- Create bot at https://discord.com/developers/applications > New Application > Bot > Create.
- Copy Token (under Bot tabâkeep secret!).
- Enable Message Content Intent (Privileged Gateway Intents).
- Invite bot: Go to OAuth2 > URL Generator > bot + applications.commands, select scopes, copy URL, visit to add to server.
- Get Channel ID: Enable Developer Mode (User Settings > Advanced), right-click channel > Copy ID.
- Config: discord.token: [TOKEN], discord.channel: [ID].
- Test: Restart serverâshould send "start" embed to channel. Player join: "Player joined" embed.
For more in-depth guide on how to set up a bot, go here to the DiscordSRV setup guide.
Advanced Bot Invite (Private):
In Developer Portal, set bot to private (no public install), remove default install link, use https://scarsz.me/authorize?client_id=[APP_ID] (customize permissions).
7. Local Status Server (Optional Polling)
- Enabled by default on port 8080.
- Visit http://localhost:8080/events for JSON: online players, uptime, MOTD, recent events (last 50).
- Note: The status server couldn't be tested on some hosted services (e.g., Exaroton) because they don't support multiple ports or deny such requests entirely. Use at your own riskâprimarily intended for self-hosted servers.
- Use ngrok (
ngrok http 8080) for public URL if needed (e.g., for external polling). - Toggle: /wl toggle-status-server on/off.
8. Troubleshooting
- No Events: Check config toggles (/wl gui), reload (/wl reload), console logs (e.g., "Sending to website - Event: join").
- Discord No Send: Invalid token/channel (test with simple bot message), bot missing permissions (Send Messages, Embed Links).
- Website No POST: URL wrong (test with curl), API key mismatch, firewall blocks outbound HTTP.
- Periodic Not Sending: website.periodic-status: true, url set, interval >0. Logs: "Website periodic status started".
- GUI No Colors: Server <1.16 or no Adventureâuse new JAR with bundled API.
- Server Crashes: Check plugins/WebsiteLinker/logs or console for stack traces.
9. How I Built This
- Used VS Code for all coding (Java/Maven project).
- API: Node.js on Render.com (git push deploys).
- Hosting: InfinityFree for PHP Website Hosting.
- Bot: Discord Developer Portal + scarsz.me for private invites.
- Testing: Done on Exaroton.
For support: Join my Discord or check plugin.yml for version. Enjoy!
- ThePurpleFox