sanjeevlegendxd_91354

When a combat log occurs that player should instantly die .the plugin records the following information:

UID (UUID) – Unique ID of the player Player Name – The name of the player who logged out Health – The health the player had before logging out Coordinates – Player location (X, Y, Z) where the logout happened Opponent Name – The player they were fighting This information helps admins understand the situation of the combat log.The plugin connects to Discord using a webhook URL.

When a combat log is detected, the plugin sends a formatted message to a Discord channel.

Kodari AI
KodariFeb 28 at 6:29 am 6,390 (v2)

I’ll create a combat logging prevention plugin that instantly kills players who disconnect during combat and sends detailed reports to Discord.

CombatLogPrevention
A comprehensive anti-combat logging system that instantly kills players who disconnect during combat. Records detailed information including UUID, player name, health, coordinates, and opponent details. Automatically sends formatted notifications to Discord via webhook when combat logs are detected. Features configurable combat tag duration and complete admin tracking capabilities.

Combat logging plugin created with instant death and Discord webhook integration. Configure your webhook URL in config.yml to start receiving combat log alerts.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
9 482
src/main/java/com/combatlog/CombatLogPrevention.java
package com.combatlog;

import com.combatlog.data.CombatLogData;
import com.combatlog.listener.CombatListener;
import com.combatlog.manager.CombatManager;
import com.combatlog.manager.DiscordManager;
import com.combatlog.command.CombatLogCommand;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.ArrayList;
import java.util.List;

@Getter
public class CombatLogPrevention extends JavaPlugin {
    
    private CombatManager combatManager;
    private DiscordManager discordManager;
    private List<CombatLogData> combatLogRecords;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.combatLogRecords = new ArrayList<>();
        this.combatManager = new CombatManager(this);
        this.discordManager = new DiscordManager(this);
        
        getServer().getPluginManager().registerEvents(new CombatListener(this), this);
        
        getCommand("combatlog").setExecutor(new CombatLogCommand(this));
        
        combatManager.startExpirationTask();
        
        getLogger().info("CombatLogPrevention has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (combatManager != null) {
            combatManager.clearAll();
        }
        getLogger().info("CombatLogPrevention has been disabled!");
    }
    
    public void addCombatLogRecord(CombatLogData data) {
        combatLogRecords.add(data);
        
        int maxRecords = getConfig().getInt("logging.max-records", 100);
        while (combatLogRecords.size() > maxRecords) {
            combatLogRecords.remove(0);
        }
    }
}