errorx.net

Build a Combat Log plugin where whenever a player hits another player, both instantly enter a combat state for 15 seconds. During this time, they are considered “in fight” and cannot escape using commands or tricks.

While in combat:

Block commands like /home, /shop, /rtp, /tpa, /spawn If they try, cancel it and show a message like: “⚔ Combat » You cannot use this command while in combat!”

If a player logs out during combat:

Treat it as a death (they lose items / die instantly) ⏱️ Combat Timer Experience Show a live countdown in the action bar like: “⚔ Combat: 15s… 14s… 13s…” Every time they get hit, the timer resets back to 15 seconds When it reaches 0, they are safe again 🟣 Ender Pearl Cooldown Idea Add a 5-second cooldown on ender pearls If player tries to use it before cooldown:

Cancel the throw Show message: “⚔ Combat » Ender Pearl cooldown: 3s remaining”

This prevents spam escaping during fights.

🎨 Prefix Idea

Use a clean, stylish prefix for all messages, for example:

“&b&lCombat &7»” Or gradient style like: “&b&lNXCOMBAT &7»" 🔥 Overall Feel Fast-paced PvP with no easy escape Clear feedback (messages + action bar timer) Balanced (players can escape only after 15s of no hits) Anti-abuse (commands + pearl cooldown blocked)

👉 Simple concept:

Hit → Combat for 15s → No commands + cooldowns → Logout = death → Timer shown live

If you want, I can next turn this into:

full working plugin code or a ready .jar with config + gradient messages

Just tell me 👍

Kodari AI
KodariApr 23 at 6:35 am 14,767 (v2)

I’ll create a comprehensive Combat Log plugin with live action bar timer, command blocking, logout punishment, and ender pearl cooldown.

NXCombat
A comprehensive combat log system that prevents players from escaping fights. When players engage in PvP, they enter combat mode with a 15-second timer that displays in the action bar. During combat, players cannot use blocked commands like /home or /spawn, logout results in instant death, and ender pearls have a 5-second cooldown. The timer automatically resets when taking damage. Features configurable messages, command blocking, and action bar updates. Perfect for competitive PvP servers.

Plugin created! NXCombat features:

✅ 15-second combat timer that resets on each hit ✅ Live action bar countdown showing remaining time ✅ Command blocking for /home, /spawn, /rtp, /tpa, etc. ✅ Logout punishment - instant death if they disconnect ✅ 5-second ender pearl cooldown during combat ✅ Configurable messages with color codes ✅ Detects both melee and projectile damage (arrows, snowballs, etc.)

The plugin tracks combat state per player, updates action bar every 0.5 seconds for smooth countdown, and automatically removes combat status when timer expires. All settings and messages are fully configurable in config.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
10 408
src/main/java/com/nxcombat/NXCombat.java
package com.nxcombat;

import com.nxcombat.listener.CombatListener;
import com.nxcombat.manager.CombatManager;
import com.nxcombat.manager.ConfigManager;
import com.nxcombat.task.ActionBarTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class NXCombat extends JavaPlugin {
    private ConfigManager configManager;
    private CombatManager combatManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.combatManager = new CombatManager(this);
        
        Bukkit.getPluginManager().registerEvents(new CombatListener(this), this);
        
        new ActionBarTask(this).runTaskTimer(this, 0L, 10L);
        
        getLogger().info("NXCombat has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("NXCombat has been disabled!");
    }
}