Suman Kapoor

Create a complete, production-ready Minecraft Paper plugin named BilluVulcanBridge for my BILLU SMP server.

Main objective

Forward only Vulcan AntiCheat logs and violation alerts to a specific Discord channel. Ignore all unrelated Minecraft console messages, chat messages, startup logs, and other plugin logs.

Server compatibility

  • Minecraft Java Edition: 1.21.5+
  • Server software: Paper
  • Java: 21+
  • Existing plugins: Vulcan AntiCheat and DiscordSRV

Configuration

Create a configurable "plugins/BilluVulcanBridge/config.yml" containing:

discord: bot-token: "PASTE_YOUR_DISCORD_BOT_TOKEN_HERE" channel-id: "PASTE_YOUR_DISCORD_CHANNEL_ID_HERE"

vulcan: filter-mode: "strict" include-violations: true include-debug-logs: false

logging: debug: false

Required features

  1. Allow me to configure my Discord bot token and destination channel ID in the plugin configuration.
  2. Forward Vulcan AntiCheat violation alerts to the configured Discord channel.
  3. Capture only verified Vulcan-related messages. Do not forward unrelated console output.
  4. Support the actual alert format produced by my installed Vulcan version. Do not assume a log prefix without verifying it.
  5. If necessary, use a supported Vulcan API or event/listener integration rather than relying only on text matching.
  6. Prevent duplicate messages and avoid flooding Discord during high-volume alerts.
  7. Format messages cleanly, including the player name, check type, violation level and alert text whenever available.
  8. Prevent Discord mentions from being triggered by player names or log contents.
  9. Handle Discord connection failures, invalid configuration, missing permissions and plugin shutdown safely.
  10. Never forward Discord bot tokens, credentials or unrelated sensitive server information.
  11. Support reloading the configuration without restarting the server, if safely possible.
  12. Keep Discord sending asynchronous so Minecraft's main server thread never waits for Discord API requests.

Technical requirements

  • Prefer reusing the existing DiscordSRV bot connection if its public API supports sending messages to a selected channel.
  • If using DiscordSRV, declare it as a dependency and compile against a compatible published API version.
  • Do not create a second Discord bot connection when reusing DiscordSRV is possible.
  • If direct bot-token authentication is required instead, explain the trade-offs and use a maintained Discord library such as JDA.
  • Never invent Vulcan API classes, events, methods or DiscordSRV API methods. Verify the actual APIs and dependency versions before implementing.
  • Do not blindly forward all "latest.log" lines or use a broad regex that matches unrelated messages.
  • Handle log rotation and restarts correctly if file monitoring is used.
  • Include "plugin.yml", "config.yml", "pom.xml", all Java source files and any required resources.

Deliverables

  1. Complete compilable Java source code.
  2. Full project directory structure.
  3. Exact Maven build commands.
  4. Instructions for installing the JAR on a Paper server.
  5. Instructions for configuring the Discord bot token and channel ID.
  6. Required Discord bot permissions and intents, if applicable.
  7. A test procedure proving that Vulcan alerts reach the channel and unrelated logs do not.
  8. A troubleshooting guide for build errors, Discord connection failures and missing Vulcan alerts.

Important: If the installed Vulcan version does not expose a supported API for obtaining alerts, explain that limitation and provide the safest verified alternative. Do not claim the plugin works until it compiles against real dependencies and its filtering method is validated.

The final result must be a working plugin JAR, not just example code.

Kodari AI
KodariOct 21 at 5:44 pm 4
VulcanDiscordBridge
A Paper plugin that forwards Vulcan AntiCheat violation alerts to a configured Discord channel via DiscordSRV. It captures only verified Vulcan messages using exact text matching with configurable filters, prevents duplicates and flooding, formats alerts with player/check/level details, blocks mentions, and handles errors safely. Messages send asynchronously off the main thread. Configuration supports bot token, channel ID, filter mode, and debug logging with runtime reload.
  1. Use Vulcan’s documented VulcanFlagEvent API, loaded reflectively so the project does not depend on an unpublished Vulcan artifact or parse console text.

  2. Reuse DiscordSRV’s published JDA connection when available; use the configured token only as a standalone fallback.

  3. Add bounded deduplication/rate limiting, safe message formatting, config reload, and lifecycle handling.

  4. Create the Maven project, plugin resources, and setup/testing guidance.

Created the BilluVulcanBridge project with pom.xml, plugin.yml, the requested config.yml, Java sources, manifest.kod, and setup/testing guidance in README.md.

The bridge listens only for Vulcan’s documented VulcanFlagEvent and reads the player, check, VL, and alert text from that event. It does not parse console output or forward chat, startup messages, or other plugins’ logs. It reuses DiscordSRV’s JDA connection when DiscordSRV is enabled; the configured token is used only when DiscordSRV is absent. It also neutralizes mentions, deduplicates alerts, bounds and rate-limits the send queue, and supports /billuvulcanbridge reload.

Compatibility caveat: I used the documented Vulcan API, but the installed Vulcan JAR and version were not available here, so I cannot claim runtime compatibility with your specific server or a validated working JAR. Vulcan must have its API enabled (enable-api: true); if that version does not expose me.frep.vulcan.api.event.VulcanFlagEvent, this plugin will report that the event API is unavailable rather than fall back to unsafe log matching.

For the JAR, use Kodari’s Compile button (desktop top bar; on phone, ⋮ → Compile Project), then download it from the build window. Install it in the Paper server’s plugins/ directory and restart. Set the channel ID in plugins/BilluVulcanBridge/config.yml; when DiscordSRV is active, configure the token in DiscordSRV’s own config. The bot needs View Channel and Send Messages; no privileged intents are needed. The README includes the project layout, test procedure, and troubleshooting steps.

Suman Kapoor

/claim

Kodari AI
KodariOct 21 at 5:50 pm 1

This workspace already contains the BilluVulcanBridge project, so it isn’t empty. What should /claim do, and should it be added to this project or built as a separate land-claim plugin?

Suman Kapoor

Am not able to compile this project

Kodari AI
KodariOct 21 at 6:05 pm 1

I’ll check the Maven dependencies and Java sources, fix the compile blocker, then summarize the exact build path.

The expected project files were missing from this workspace, so there was nothing to compile. I’ve recreated the Maven project, including its Paper plugin files and Java sources. It listens for Vulcan’s structured flag event and won’t scan console logs as a fallback.

To build and download the JAR, click Compile in the desktop top bar, or on your phone tap ⋮ → Compile Project, then click Compile in the window. I can’t confirm a successful build until that completes. If it fails, use Auto-fix in chat or Fix in the build window.

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
README.md
Code
8 532
src/main/java/com/billusmp/billuvulcanbridge/BilluVulcanBridgePlugin.java
package com.billusmp.billuvulcanbridge;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;

public final class BilluVulcanBridgePlugin extends JavaPlugin {
    private final Map<String, Long> recentAlerts = new HashMap<>();
    private Settings settings;
    private DiscordMessageTransport transport;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        try {
            settings = readSettings();
            transport = DiscordMessageTransport.connect(this, settings.channelId(), settings.botToken());
        } catch (Exception exception) {
            getLogger().severe("BilluVulcanBridge could not start (" + exception.getClass().getSimpleName() + "). Check its configuration and Discord connection.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        new VulcanAlertListener(this).register();
        if (settings.includeDebugLogs()) {
            getLogger().warning("Vulcan debug-log forwarding is unsupported; only structured Vulcan flag events are forwarded.");
        }
        debug("Bridge enabled in strict event-only mode.");
    }

    @Override
    public void onDisable() {
        if (transport != null) {
            transport.close();
            transport = null;
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!command.getName().equalsIgnoreCase("billuvulcanbridge")) {
            return false;
        }
        if (args.length != 1 || !args[0].equalsIgnoreCase("reload")) {
            sender.sendMessage("Usage: /billuvulcanbridge reload");
            return true;
        }
        if (!sender.hasPermission("billuvulcanbridge.reload")) {
            sender.sendMessage("You do not have permission to do that.");
            return true;
        }

        reloadConfig();
        try {
            Settings replacementSettings = readSettings();
            DiscordMessageTransport replacementTransport = DiscordMessageTransport.connect(
                    this, replacementSettings.channelId(), replacementSettings.botToken());
            DiscordMessageTransport previousTransport = transport;
            transport = replacementTransport;
            settings = replacementSettings;
            if (previousTransport != null) {
                previousTransport.close();
            }
            recentAlerts.clear();
            sender.sendMessage("BilluVulcanBridge configuration reloaded.");
            debug("Configuration reloaded.");
        } catch (Exception exception) {
            sender.sendMessage("Reload failed. The previous bridge configuration remains active; check the server log.");
            getLogger().severe("Configuration reload failed (" + exception.getClass().getSimpleName() + "). The previous bridge remains active.");
        }
        return true;
    }

    void handleFlag(String playerName, UUID playerId, String checkName, String checkType,
                    int violationLevel, int maximumViolationLevel, String alertText) {
        Settings current = settings;
        DiscordMessageTransport currentTransport = transport;
        if (current == null || currentTransport == null || !current.includeViolations()) {
            return;
        }

        long now = System.currentTimeMillis();
        String deduplicationKey = playerId + "|" + checkName + "|" + checkType + "|"
                + violationLevel + "|" + (alertText == null ? "" : alertText);
        Long previous = recentAlerts.get(deduplicationKey);
        if (previous != null && now - previous < 2_000) {
            return;
        }
        recentAlerts.put(deduplicationKey, now);
        trimRecentAlerts(now);

        StringBuilder message = new StringBuilder("Vulcan violation | Player: ")
                .append(playerName)
                .append(" | Check: ").append(checkName);
        if (checkType != null && !checkType.isBlank()) {
            message.append(' ').append(checkType);
        }
        message.append(" | VL: ").append(violationLevel);
        if (maximumViolationLevel > 0) {
            message.append('/').append(maximumViolationLevel);
        }
        if (alertText != null && !alertText.isBlank()) {
            message.append(" | Alert: ").append(alertText);
        }
        currentTransport.send(neutralizeMentions(message.toString()));
    }

    void reportVulcanReadFailure(Exception exception) {
        getLogger().warning("Could not read a Vulcan flag event (" + exception.getClass().getSimpleName() + ").");
    }

    void debug(String message) {
        if (settings != null && settings.debugLogging()) {
            getLogger().info("[debug] " + message);
        }
    }

    private Settings readSettings() {
        String channelId = getConfig().getString("discord.channel-id", "").trim();
        if (!channelId.matches("[0-9]{16,22}")) {
            throw new IllegalArgumentException("discord.channel-id must be a numeric Discord channel ID");
        }

        String filterMode = getConfig().getString("vulcan.filter-mode", "strict").trim();
        if (!filterMode.equalsIgnoreCase("strict")) {
            throw new IllegalArgumentException("Only strict Vulcan event filtering is supported");
        }

        String botToken = getConfig().getString("discord.bot-token", "").trim();
        org.bukkit.plugin.Plugin discordSrv = getServer().getPluginManager().getPlugin("DiscordSRV");
        if ((discordSrv == null || !discordSrv.isEnabled())
                && (botToken.isBlank() || botToken.equals("PASTE_YOUR_DISCORD_BOT_TOKEN_HERE"))) {
            throw new IllegalArgumentException("discord.bot-token is required when DiscordSRV is not installed");
        }

        return new Settings(channelId, botToken,
                getConfig().getBoolean("vulcan.include-violations", true),
                getConfig().getBoolean("vulcan.include-debug-logs", false),
                getConfig().getBoolean("logging.debug", false));
    }

    private void trimRecentAlerts(long now) {
        if (recentAlerts.size() <= 512) {
            return;
        }
        Iterator<Map.Entry<String, Long>> iterator = recentAlerts.entrySet().iterator();
        while (iterator.hasNext()) {
            if (now - iterator.next().getValue() > 5_000) {
                iterator.remove();
            }
        }
        while (recentAlerts.size() > 512) {
            iterator = recentAlerts.entrySet().iterator();
            if (iterator.hasNext()) {
                iterator.next();
                iterator.remove();
            }
        }
    }

    private String neutralizeMentions(String message) {
        String safe = message.replace("@", "@\u200B")
                .replaceAll("[\\r\\n\\t]+", " ")
                .replaceAll("[\\p{Cntrl}&&[^\\t]]", "");
        return safe.length() <= 1_900 ? safe : safe.substring(0, 1_899) + "…";
    }

    private record Settings(String channelId, String botToken, boolean includeViolations,
                            boolean includeDebugLogs, boolean debugLogging) {
    }
}