workinghome63-design

Role: Professional Java Plugin Developer (Spigot/Paper API 1.21.10).

Plugin Name: Auction Combat Dependencies: ProtocolLib (for Packet-based visuals), WorldGuard API (for Region detection).

Task: Create a high-performance, LAG-FREE Combat Tag plugin. Internal statistics are EXCLUDED; the plugin must focus on a Dynamic 3-block ghost border and a Kill-Attribution system that integrates with external plugins.

1. TARGETED BOUNDARY BORDER (STRICT LOGIC)

  • Border Location: The ghost wall MUST ONLY appear at the exact intersection/edge where a WorldGuard region (Safezone) meets the Wilderness.
  • No Open-World Walls: Do NOT show any walls if the combat is happening in the middle of the wilderness. The wall only triggers when a tagged player approaches a protected region boundary.
  • Dynamic Y-Axis: The wall MUST align with the player's current elevation. It must start exactly at the player's feet (Y+0) and extend 3 blocks UP (Total 3 blocks high), regardless of height (Mountain/Building).
  • Packet-Based Visuals: Use ProtocolLib for 'Fake Blocks' (Ghost Packets). NO real blocks should be placed or broken in the world.
  • Anti-Glitch Protection:

* Block entry from the Top, Bottom, and Sides during combat. * Anti-Pearl Glitch: If a tagged player throws an Ender Pearl into a Safezone, cancel the pearl and the teleport instantly.

  • Material Picker: Change 'WallBlock' material (Default: RED_STAINED_GLASS) via INVENTORY GUI.

2. SMART KILL ATTRIBUTION (EXTERNAL STATS FRIENDLY)

  • Kill on Logout: If a player disconnects while tagged, they must be KILLED instantly (player.setHealth(0)).
  • Kill Counting Logic:

* The plugin MUST trigger a formal 'PlayerDeathEvent'. * The 'Killer' entity must be explicitly set to the Attacker. * This ensures that any EXTERNAL statistics plugin (Leaderboards/Stats) counts this as a real kill for the attacker.

  • Inventory Logic:

* If a player dies via logout, their items must drop normally. * Respect the 'keepInventory' gamerule unless 'ForceDropOnLogout' is toggled True in INVENTORY GUI.

3. INVENTORY GUI MANAGEMENT MENU (/ac menu)

Create an interactive INVENTORY GUI to manage these settings (instantly saved to config.yml):

  • ActionBarToggle | VisualWallToggle | CommandBlockToggle | CombatLogKill | InventoryDropToggle.
  • Timer Editors: INVENTORY GUI buttons to increase/decrease 'CombatTime' and 'PearlCooldown' seconds.
  • Material Selection: Change the ghost wall block type instantly via INVENTORY GUI.

4. UNIVERSAL COLOR & LANGUAGE SYSTEM

  • messages.yml: Create a dedicated file for ALL text (Prefixes, INVENTORY GUI titles, Action Bar, alerts).
  • Color Support: Full support for HEX (#ffffff), Legacy (&c), and Gradients/MiniMessage.
  • Custom Prefix: Support an editable 'PluginPrefix' variable for all messages.

5. PERFORMANCE & WORLD MANAGEMENT

  • World Blacklist: Add a 'DisabledWorlds' list in config.yml (Plugin is 100% inactive there).
  • Performance: Ensure asynchronous handling where possible to prevent server or mobile lag.
  • Command Whitelist: Allow specific commands (e.g., /msg, /r) during combat.
  • Synchronized Action Bar: Show "COMBAT: {time}s | PEARL: {time}s" on a single line.

6. COMMANDS & TECHNICAL

  • Commands: /ac menu, /ac reload (Refresh all files).
  • Permissions: auctioncombat.admin.
  • IMPORTANT: Do not include internal statistics tracking or a /ac stats command.
Kodari AI
KodariMar 11 at 7:14 am 24,959 (v2)

I’ll create a high-performance Combat Tag plugin with dynamic boundary borders and kill attribution system.

AuctionCombat
A lightweight combat tag plugin featuring ProtocolLib packet-based ghost borders at WorldGuard region boundaries, smart kill attribution for external statistics plugins, and a fully customizable GUI management system. Includes anti-glitch protection, pearl cooldown tracking, synchronized action bars, and comprehensive color support with HEX, legacy, and MiniMessage formatting.

Now I’ll create the complete plugin structure with all necessary files.

Files created successfully! The plugin includes:

Core Features:

  • Dynamic ProtocolLib packet-based ghost borders at WorldGuard region boundaries

  • Smart kill attribution system that triggers PlayerDeathEvent for external stats plugins

  • Comprehensive GUI management menu with live configuration editing

  • Full MiniMessage, HEX, and legacy color support

  • Action bar synchronization showing combat timer and pearl cooldown

  • Pearl anti-glitch protection and cooldown tracking

  • World blacklist support

  • Command whitelist during combat

Architecture:

  • 5 managers (Combat, Border, Region, Config, Message)

  • GUI framework with button-based system

  • Event-driven combat tagging

  • Asynchronous border calculations for performance

  • Automatic cleanup and memory management

All files compile correctly with proper imports, XSeries usage, and no Bukkit enum access.

workinghome63-design

🛡️ Auction Combat: Final Refinement, Fixes & New Features

Please implement the following logic fixes and new features to ensure the plugin is professional, glitch-proof, and optimized:

1. SMART CONFIG RELOAD (INVENTORY GUI REFRESH FIX)

  • Issue: Updating config.yml and using /ac reload does not refresh the values shown in the /ac menu.
  • Requirement: The reload command MUST re-initialize the INVENTORY GUI classes so that the menu reflects the NEW config values (Toggles, Materials, Timers) immediately without a server restart.

2. COMMAND TAB-COMPLETION

  • Requirement: Add a TabCompleter for the /auctioncombat (and /ac) command.
  • Logic: Typing '/ac ' followed by TAB must suggest: 'menu' and 'reload'. No manual typing of sub-commands should be required.

3. STRICT BORDER BYPASS & ANTI-ENTRY (FIX)

  • Movement Control: If a tagged player tries to cross into a WorldGuard Safezone:

* Cancel the PlayerMoveEvent. * Instantly teleport the player back 0.5 blocks into the Wilderness.

  • Anti-Pearl Bypass: Any Ender Pearl thrown towards/into a Safezone by a tagged player must be deleted/cancelled instantly.
  • Dynamic Y-Axis: The 3-block high ghost wall (packets) must always start at the player's CURRENT feet level (Y+0) and stay 3 blocks high, regardless of the player's elevation (mountains or buildings).

4. KILL-COUNT ATTRIBUTION (LOGOUT FIX)

  • Issue: Logout-kills are currently not recorded by external statistics/leaderboard plugins.
  • Fix: When a tagged player logs out:

* Execute 'victim.damage(1000, attacker);' to credit the kill to the attacker. * Ensure a formal 'PlayerDeathEvent' is triggered where 'getKiller()' returns the attacker. * This allows external plugins to count the kill and death correctly.

5. DEATH RESET SYSTEM

  • Requirement: Clear all combat data upon death to ensure a clean respawn.
  • Logic: On 'PlayerDeathEvent', instantly reset the player's Combat Tag timer and Pearl Cooldown timer to 0.

6. DUAL-MODE PEARL COOLDOWN

  • Implement two modes toggleable via the /ac menu:

* Global Mode: Pearl cooldown applies to everyone in the world at all times. * Combat Mode: Pearl cooldown ONLY applies when a player is actively combat-tagged.

  • Settings: The cooldown duration must be editable via the INVENTORY GUI.

7. GLOBAL WORLD SUPPORT (REGION INDEPENDENCE)

  • Logic: The plugin must apply Combat Tags for PvP damage occurring ANYWHERE in the world, even if no WorldGuard regions are present.
  • Scope: The plugin should only be inactive in worlds listed in 'DisabledWorlds' in the config.

8. TECHNICAL STANDARDS

  • Visuals: Use only 'Ghost Packets' (ProtocolLib) for the border. No real blocks in the world.
  • Colors: Maintain full HEX (#ffffff) and Legacy (&c) support for all messages and prefixes in 'messages.yml'.
  • Performance: Ensure asynchronous handling to prevent any lag on server or mobile devices.
workinghome63-design

🛡️ Auction Combat: Final Refinement, Fixes & New Features

Please implement the following logic fixes and new features to ensure the plugin is professional, glitch-proof, and optimized:

1. SMART CONFIG RELOAD (INVENTORY GUI REFRESH FIX)

  • Issue: Updating config.yml and using /ac reload does not refresh the values shown in the /ac menu.
  • Requirement: The reload command MUST re-initialize the INVENTORY GUI classes so that the menu reflects the NEW config values (Toggles, Materials, Timers) immediately without a server restart.

2. COMMAND TAB-COMPLETION

  • Requirement: Add a TabCompleter for the /auctioncombat (and /ac) command.
  • Logic: Typing '/ac ' followed by TAB must suggest: 'menu' and 'reload'. No manual typing of sub-commands should be required.

3. STRICT BORDER BYPASS & ANTI-ENTRY (FIX)

  • Movement Control: If a tagged player tries to cross into a WorldGuard Safezone:

* Cancel the PlayerMoveEvent. * Instantly teleport the player back 0.5 blocks into the Wilderness.

  • Anti-Pearl Bypass: Any Ender Pearl thrown towards/into a Safezone by a tagged player must be deleted/cancelled instantly.
  • Dynamic Y-Axis: The 3-block high ghost wall (packets) must always start at the player's CURRENT feet level (Y+0) and stay 3 blocks high, regardless of the player's elevation (mountains or buildings).

4. KILL-COUNT ATTRIBUTION (LOGOUT FIX)

  • Issue: Logout-kills are currently not recorded by external statistics/leaderboard plugins.
  • Fix: When a tagged player logs out:

* Execute 'victim.damage(1000, attacker);' to credit the kill to the attacker. * Ensure a formal 'PlayerDeathEvent' is triggered where 'getKiller()' returns the attacker. * This allows external plugins to count the kill and death correctly.

5. DEATH RESET SYSTEM

  • Requirement: Clear all combat data upon death to ensure a clean respawn.
  • Logic: On 'PlayerDeathEvent', instantly reset the player's Combat Tag timer and Pearl Cooldown timer to 0.

6. DUAL-MODE PEARL COOLDOWN

  • Implement two modes toggleable via the /ac menu:

* Global Mode: Pearl cooldown applies to everyone in the world at all times. * Combat Mode: Pearl cooldown ONLY applies when a player is actively combat-tagged.

  • Settings: The cooldown duration must be editable via the INVENTORY GUI.

7. GLOBAL WORLD SUPPORT (REGION INDEPENDENCE)

  • Logic: The plugin must apply Combat Tags for PvP damage occurring ANYWHERE in the world, even if no WorldGuard regions are present.
  • Scope: The plugin should only be inactive in worlds listed in 'DisabledWorlds' in the config.

8. TECHNICAL STANDARDS

  • Visuals: Use only 'Ghost Packets' (ProtocolLib) for the border. No real blocks in the world.
  • Colors: Maintain full HEX (#ffffff) and Legacy (&c) support for all messages and prefixes in 'messages.yml'.
  • Performance: Ensure asynchronous handling to prevent any lag on server or mobile devices.
Kodari AI
KodariMar 16 at 6:38 am 33,982 (v2)

I’ll analyze the current implementation and implement all requested features with proper fixes.

I’ll implement all requested features with comprehensive fixes.

Implementation Plan

I’ll implement all 8 requested features:

  1. Smart config reload with GUI refresh

  2. Tab completion for /ac command

  3. Strict border bypass prevention with teleportback & pearl cancellation

  4. Kill attribution on logout using damage() call

  5. Death reset system

  6. Dual-mode pearl cooldown (global/combat-only)

  7. Global world support (remove region dependency)

  8. Dynamic Y-axis border positioning

All features implemented successfully:

✅ Smart Config Reload - /ac reload now refreshes all open GUI menus instantly via GUIManager.refreshAllOpenGUIs()

✅ Tab Completion - Added AuctionCombatTabCompleter suggesting “menu” and “reload” when typing /ac

✅ Strict Border Bypass - Movement into safezones is now cancelled and player is teleported 0.5 blocks back. Ender pearls thrown towards safezones are cancelled instantly. Dynamic Y-axis positioning starts at player’s feet level.

✅ Kill Attribution - Logout during combat now calls player.damage(1000.0, attacker) to trigger proper PlayerDeathEvent with killer attribution for external stats plugins

✅ Death Reset System - PlayerDeathEvent handler calls CombatManager.resetOnDeath() to clear all combat and pearl cooldown timers

✅ Dual-Mode Pearl Cooldown - New pearl.mode config (combat/global). “Global” applies cooldown to everyone, “Combat” only to tagged players. Toggleable in GUI with compass/sword icon

✅ Global World Support - Removed canPvpAt() check from CombatListener - now tags players on ANY PvP damage outside disabled worlds

✅ Technical Standards - Dynamic Y-axis border positioning, async border calculations, MiniMessage HEX colors maintained throughout

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
23 1,659
src/main/java/com/auctioncombat/AuctionCombat.java
package com.auctioncombat;

import com.auctioncombat.commands.AuctionCombatCommand;
import com.auctioncombat.commands.AuctionCombatTabCompleter;
import com.auctioncombat.inventory.gui.GUIListener;
import com.auctioncombat.inventory.gui.GUIManager;
import com.auctioncombat.listeners.CombatListener;
import com.auctioncombat.listeners.PlayerListener;
import com.auctioncombat.listeners.RegionListener;
import com.auctioncombat.managers.BorderManager;
import com.auctioncombat.managers.CombatManager;
import com.auctioncombat.managers.ConfigManager;
import com.auctioncombat.managers.MessageManager;
import com.auctioncombat.managers.RegionManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class AuctionCombat extends JavaPlugin {
    private ConfigManager configManager;
    private MessageManager messageManager;
    private CombatManager combatManager;
    private BorderManager borderManager;
    private RegionManager regionManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        if (!setupDependencies()) {
            getLogger().severe("Missing required dependencies! Disabling plugin...");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }

        this.configManager = new ConfigManager(this);
        this.messageManager = new MessageManager(this);
        this.regionManager = new RegionManager(this);
        this.combatManager = new CombatManager(this);
        this.borderManager = new BorderManager(this);
        this.guiManager = new GUIManager();

        registerCommands();
        registerListeners();

        this.combatManager.startActionBarTask();

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

    @Override
    public void onDisable() {
        if (this.combatManager != null) {
            this.combatManager.shutdown();
        }
        if (this.borderManager != null) {
            this.borderManager.shutdown();
        }
        getLogger().info("AuctionCombat has been disabled!");
    }

    private boolean setupDependencies() {
        if (Bukkit.getPluginManager().getPlugin("ProtocolLib") == null) {
            getLogger().severe("ProtocolLib not found!");
            return false;
        }
        if (Bukkit.getPluginManager().getPlugin("WorldGuard") == null) {
            getLogger().severe("WorldGuard not found!");
            return false;
        }
        return true;
    }

    private void registerCommands() {
        getCommand("ac").setExecutor(new AuctionCombatCommand(this));
        getCommand("ac").setTabCompleter(new AuctionCombatTabCompleter());
    }

    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new CombatListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this), this);
        Bukkit.getPluginManager().registerEvents(new RegionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(this.guiManager), this);
    }

    public void reload() {
        this.configManager.reload();
        this.messageManager.reload();
        this.guiManager.refreshAllOpenGUIs();
    }
}