Abandoned • EOL End of Life Notice: This Minecraft plugin has been abandoned and is no longer maintained or supported. Kept online for archive & reference only.

Website and Discord Plugin

WebsiteLinker Plugin Guide v1.1.4 - Made by ThePurpleFox

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

2. Server Installation (Minecraft Side)

For self-hosted servers:

  1. 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.
  2. 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).
  3. 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).
  4. 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

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):

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).

  1. Create folder (e.g., api-folder), open in VS Code.
  2. Run npm init -y, then npm install express body-parser cors fs.
  3. Create server.js (root code below—no tokens):
  4. 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}`);
    });
  5. Create public/index.html (dashboard—fetches /api/events, shows events list/table).
  6. Create .env: PORT=3000 (optional).
  7. Deploy to Render: New Web Service > Connect GitHub repo > Build: npm install, Start: node server.js.
  8. 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]).

Option 2: Use GitHub Codespaces (Free for development/testing).

  1. Create a new repository on GitHub for your API.
  2. Enable Codespaces in the repo settings.
  3. Open Codespaces, set up your Node.js API code (use the example above).
  4. Run locally in Codespaces for testing (forward ports for external access).
  5. 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.

  1. Choose a host (e.g., DigitalOcean VPS, AWS EC2, or local machine with public IP/domain).
  2. Install Node.js runtime.
  3. Deploy your API code (use examples from Option 1 or 2).
  4. Configure domain/SSL (e.g., via Let's Encrypt) and firewall for port 80/443.
  5. Set plugin config website.url: https://your-custom-domain.com/api/events.
  6. 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)

  1. Create bot at https://discord.com/developers/applications > New Application > Bot > Create.
  2. Copy Token (under Bot tab—keep secret!).
  3. Enable Message Content Intent (Privileged Gateway Intents).
  4. Invite bot: Go to OAuth2 > URL Generator > bot + applications.commands, select scopes, copy URL, visit to add to server.
  5. Get Channel ID: Enable Developer Mode (User Settings > Advanced), right-click channel > Copy ID.
  6. Config: discord.token: [TOKEN], discord.channel: [ID].
  7. 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)

8. Troubleshooting

9. How I Built This

For support: Join my Discord or check plugin.yml for version. Enjoy!

- ThePurpleFox

Get Plugin