Create KaizenSMPchat, a complete Java Maven Paper 26.3 plugin, with plugin.yml, config.yml, README and dependencies. Implement a real asynchronous Discord bot bridge (configured guild and separate chat/log channels, reconnect, status, rate limits via suitable library, no token disclosure, safe shutdown/reload, long-message handling, no loops or bot messages), configurable embeds and Minecraft↔Discord public chat. Log join/leave/kick and detectable bans, unbans, whitelist/op and administration changes, deaths with cause/killer/world, advancements, dimension/respawn/gamemode, sleep/wake, dragon/wither, raids, ender chest, totems, configurable valuable pickups/drops/crafting, anvil/enchant/brewing/beacon, startup/shutdown/errors as reliably supported. Deduplicate and use configurable opt-in settings for noisy events. Implement PvP tracking for multiple opponents with configurable 10-second refreshed expiry, private involved-player start notifications, accurate single combat-logout broadcast/Discord/console including opponent and elapsed combat time, never punish or kill on logout, clean state on expiry/shutdown; implement configurable combat-only ender pearl cooldown. Commands /kschat help, reload, status, test, combat, version with kaizensmpchat.admin/reload/status/combat permissions. Document configuration, Discord privileged intents, deployment and any events that cannot be detected reliably instead of inventing results. Respect Paper threading; don't block server thread for Discord. Provide full source and beginner installation instructions. Target Paper 26.3 and required Java version where the environment supports it; honestly document any compatibility limitations. Feature code only; do not add tests.

Kodari AI
KodariToday at 11:01 am 4
KaizenSMPChat
A comprehensive Paper 26.3 plugin bridging Minecraft and Discord with a real asynchronous bot. Features bidirectional public chat with configurable embeds, comprehensive event logging (joins, quits, deaths with causes, advancements, raids, totems, pickups, crafting, enchanting, brewing, and more), PvP combat tracking with multi-opponent support and configurable expiry, combat-logout broadcasting, and combat-only ender pearl cooldown. Includes /kschat commands for help, reload, status, test, combat, and version with proper permissions. Handles Discord reconnects, rate limits, long messages, and safe shutdown without blocking the server thread. All noisy events are configurable and deduplicated.
  • Build the asynchronous Discord bridge and configurable event logging.

  • Add combat tracking, commands, and installation documentation.

Created KaizenSMPchat with the Discord bridge, event logging, combat tracking, commands, configuration, and beginner installation instructions.

Compatibility limitation: the project targets the Paper 1.21.11 API with Java 21; Paper 26.3 compatibility has not been verified. The README documents detection and delivery limitations.

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
README.md
Code
8 474
src/main/java/com/kaizensmp/chat/KaizenSMPchat.java
package com.kaizensmp.chat;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;

public final class KaizenSMPchat extends JavaPlugin {
    private DiscordBridge bridge;
    private GameEvents events;

    @Override public void onEnable() {
        saveDefaultConfig();
        events = new GameEvents(this);
        Bukkit.getPluginManager().registerEvents(events, this);
        bridge = new DiscordBridge(this);
        bridge.start();
        logEvent("lifecycle", "Server / plugin started");
    }

    @Override public void onDisable() {
        if (events != null) events.shutdown();
        if (bridge != null) {
            if (getConfig().getBoolean("events.lifecycle", true)) bridge.sendLog("Server / plugin shutting down");
            bridge.shutdown();
        }
    }

    public void logEvent(String key, String text) {
        if (getConfig().getBoolean("events." + key, false)) bridge.sendLog(text);
    }

    public void chatToDiscord(String name, String message) {
        if (getConfig().getBoolean("chat.minecraft-to-discord", true)) bridge.sendChat(name + ": " + message);
    }

    public void discordToChat(String name, String message) {
        if (!isEnabled()) return;
        Bukkit.getScheduler().runTask(this, () -> {
            if (!getConfig().getBoolean("chat.discord-to-minecraft", true)) return;
            String format = ChatColor.translateAlternateColorCodes('&', getConfig().getString("chat.discord-format", "&9[Discord] &f{user}: &7{message}"));
            Bukkit.broadcastMessage(format.replace("{user}", name).replace("{message}", message));
        });
    }

    @Override public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        String sub = args.length == 0 ? "help" : args[0].toLowerCase(java.util.Locale.ROOT);
        switch (sub) {
            case "help":
                sender.sendMessage("§b/kschat help, version, combat, status, test, reload"); return true;
            case "version": sender.sendMessage("§bKaizenSMPchat " + getDescription().getVersion()); return true;
            case "combat":
                if (!sender.hasPermission("kaizensmpchat.combat")) { sender.sendMessage("§cNo permission."); return true; }
                if (!(sender instanceof Player)) { sender.sendMessage("Players only."); return true; }
                sender.sendMessage(events.combatStatus((Player) sender)); return true;
            case "status": case "test":
                if (!sender.hasPermission("kaizensmpchat.status")) { sender.sendMessage("§cNo permission."); return true; }
                if (sub.equals("test")) { bridge.sendLog("KaizenSMPchat test message"); sender.sendMessage("§aTest queued; check the Discord log channel."); }
                else sender.sendMessage("§bDiscord: " + bridge.status());
                return true;
            case "reload":
                if (!sender.hasPermission("kaizensmpchat.reload")) { sender.sendMessage("§cNo permission."); return true; }
                bridge.shutdown(); reloadConfig(); events.clearCombat(); bridge = new DiscordBridge(this); bridge.start();
                sender.sendMessage("§aKaizenSMPchat configuration reloaded."); return true;
            default: sender.sendMessage("§cUnknown subcommand. Use /kschat help."); return true;
        }
    }
}