amiteshmohanty896-boop

Create a simple Minecraft Paper plugin called CombatDiscordLog for Java 17.

Features:

Detect when a player is in combat.

If the player disconnects during combat, automatically send a Discord webhook message.

Webhook message should include:

Player name Opponent name Player coordinates World name Health before logout Time of logout Combat timer should be configurable in config.yml (default 20 seconds).

Use Paper API.

Use clean and optimized code.

Async webhook requests.

Include:

Main class Combat listener Webhook manager plugin.yml config.yml pom.xml Add colored console messages.

Kodari AI
KodariMay 19 at 5:00 am 8,347 (v2)

I’ll create a combat logging plugin that tracks PvP combat and reports combat loggers to Discord.

CombatDiscordLog
A Paper plugin that detects when players disconnect during PvP combat and automatically sends detailed Discord webhook notifications. Tracks combat state with configurable timers, logs player names, opponent info, coordinates, world, health, and logout time. Features async webhook delivery and colored console messages for clear server-side logging.

Created a complete combat logging plugin with Discord webhook integration!

Structure:

  • CombatDiscordLog.java - Main class with colored console logging (Adventure API)

  • CombatManager.java - Tracks combat state with configurable timers

  • WebhookManager.java - Async Discord webhook delivery via CompletableFuture

  • CombatListener.java - Detects PvP damage (melee + projectiles) and quit events

  • Configuration with customizable messages, timer, and webhook formatting

Key Features:

  • Both attacker and victim are tagged in combat

  • Combat timer auto-expires and notifies player

  • Webhook includes all requested data (name, opponent, coords, world, health, timestamp)

  • Permission bypass: combatdiscordlog.bypass

  • Handles projectile combat (arrows, tridents, etc.)

  • Async HTTP requests prevent server lag

  • Clean Adventure API console messages (aqua, yellow, red)

Setup: Add your Discord webhook URL to config.yml and adjust combat timer as needed. Build with mvn clean package.

amiteshmohanty896-boop

i need the combat system with only the players so dont give combat with normal damages in game

amiteshmohanty896-boop

i need the combat system with only the players so dont give combat with normal damages in game

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
7 472
src/main/java/com/example/combatdiscordlog/CombatDiscordLog.java
package com.example.combatdiscordlog;

import com.example.combatdiscordlog.listener.CombatListener;
import com.example.combatdiscordlog.manager.CombatManager;
import com.example.combatdiscordlog.manager.WebhookManager;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import org.bukkit.plugin.java.JavaPlugin;

public class CombatDiscordLog extends JavaPlugin {
    
    private CombatManager combatManager;
    private WebhookManager webhookManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.combatManager = new CombatManager(this);
        this.webhookManager = new WebhookManager(this);
        
        getServer().getPluginManager().registerEvents(new CombatListener(this), this);
        
        logInfo("CombatDiscordLog has been enabled!");
        
        String webhookUrl = getConfig().getString("webhook-url", "");
        if (webhookUrl.isEmpty()) {
            logWarning("No webhook URL configured! Webhook notifications are disabled.");
            logWarning("Set 'webhook-url' in config.yml to enable Discord notifications.");
        } else {
            logInfo("Discord webhook integration enabled.");
        }
    }
    
    @Override
    public void onDisable() {
        if (combatManager != null) {
            combatManager.shutdown();
        }
        logInfo("CombatDiscordLog has been disabled!");
    }
    
    public CombatManager getCombatManager() {
        return combatManager;
    }
    
    public WebhookManager getWebhookManager() {
        return webhookManager;
    }
    
    public void logInfo(String message) {
        getServer().getConsoleSender().sendMessage(
            Component.text("[CombatDiscordLog] ", NamedTextColor.AQUA)
                .append(Component.text(message, NamedTextColor.WHITE))
        );
    }
    
    public void logWarning(String message) {
        getServer().getConsoleSender().sendMessage(
            Component.text("[CombatDiscordLog] ", NamedTextColor.YELLOW)
                .append(Component.text(message, NamedTextColor.GOLD))
        );
    }
    
    public void logError(String message) {
        getServer().getConsoleSender().sendMessage(
            Component.text("[CombatDiscordLog] ", NamedTextColor.RED)
                .append(Component.text(message, NamedTextColor.DARK_RED))
        );
    }
}