itz_foliz

Make me an combat plugin where it tells U how long it is on the boss bar and tells U in chat that Ur in combat and with who and prevent U from going in to any worldgurd region and by default the combat time is 15s and add a config for Minecraft paper 1.21

Kodari AI
KodariMar 9 at 9:53 pm 9,055 (v2)

I’ll create a combat logger plugin with boss bar timer, chat notifications, and WorldGuard region protection.

CombatLogger
A comprehensive combat logging system for PvP servers. When players engage in combat, they receive boss bar countdown timers and chat notifications identifying their opponent. Combat-tagged players are prevented from entering WorldGuard regions for the duration of their combat status. Features configurable combat duration, customizable messages, and automatic combat status cleanup. Designed for Paper 1.21 with full WorldGuard integration.

Plugin created with all requested features: boss bar countdown, chat notifications, WorldGuard region protection, and configurable 15-second combat timer.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 498
src/main/java/com/combatlogger/CombatLogger.java
package com.combatlogger;

import com.combatlogger.data.PlayerCombatData;
import com.combatlogger.listener.CombatListener;
import com.combatlogger.listener.RegionListener;
import com.combatlogger.manager.BossBarManager;
import com.combatlogger.manager.CombatManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CombatLogger extends JavaPlugin {

    private CombatManager combatManager;
    private BossBarManager bossBarManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        this.combatManager = new CombatManager(this);
        this.bossBarManager = new BossBarManager(this);

        getServer().getPluginManager().registerEvents(new CombatListener(this), this);
        getServer().getPluginManager().registerEvents(new RegionListener(this), this);

        getCommand("combat").setExecutor(new com.combatlogger.command.CombatCommand(this));

        bossBarManager.startUpdateTask();

        getLogger().info("CombatLogger has been enabled!");
    }

    @Override
    public void onDisable() {
        if (bossBarManager != null) {
            bossBarManager.shutdown();
        }
        if (combatManager != null) {
            combatManager.clearAll();
        }
        getLogger().info("CombatLogger has been disabled!");
    }

    public void reload() {
        reloadConfig();
        if (bossBarManager != null) {
            bossBarManager.shutdown();
            bossBarManager.startUpdateTask();
        }
    }
}