MihneaShaff

Core Features

Flexible Combat Modes: * Kit Duels: Choose from a pre-defined selection of kits for a fair, skill-based fight.

Inventory Duels: Risk it all. Players can wager their entire current inventory. To ensure fairness, both players must "Inspect & Accept" the opponent's gear before the match begins.

Integrated Wagering: * Full support for Vault (Economy) and BeastTokens.

Wagers are held in escrow and automatically distributed to the victor.

Intuitive Trade-Style INVENTORY GUI:

Once a duel is initiated, a sleek INVENTORY GUI opens where players toggle kits, tokens, and money.

Features a "Dual-Lock" confirmation system (similar to /trade) to prevent last-second item switching or scamming.

Smart Arena Management:

Ships with support for 3 distinct arenas.

Automated Queueing: If all arenas are occupied, the plugin intelligently notifies players and prevents the duel start, keeping your server performance high.

The Duel Workflow

The Challenge: Player A sends /duel <name>.

The Response: Player B can /duel accept or reject.

The Negotiation: A INVENTORY GUI opens. Both players select their wagers (Tokens, Money, or Inventories). If Inventories are selected, a sub-menu allows players to view exactly what the opponent is carrying.

The Commitment: Both players click "Ready." Once both lock in, the countdown begins.

The Battle: Players are teleported to an available arena. The winner takes the pot; the loser goes home empty-handed. all should be async

Kodari AI
KodariJan 12 at 8:18 am 18,844 (v2)

I’ll create a comprehensive async dueling plugin with GUI-based wager system and smart arena management.

AsyncDuels
A comprehensive dueling system with kit-based and inventory-wager combat modes. Features include Vault/BeastTokens integration, trade-style GUI with dual-lock confirmation, smart arena queueing, and fully asynchronous operations for optimal performance. Players can wager economy, tokens, or entire inventories with inspection system.

Project initialized! This async dueling plugin includes:

Core Systems:

  • GUI-based duel negotiation with dual-lock confirmation

  • Kit selection and inventory wagering modes

  • Vault & BeastTokens economy integration

  • Smart arena queueing (3 arenas with occupancy tracking)

  • Full async command processing

Features Implemented:

  • /duel <player> to challenge

  • /duel accept/reject for responses

  • Trade-style GUI for wager selection

  • Inventory inspection system for fairness

  • Automatic escrow and winner distribution

  • Combat tracking and death handling

  • Session cleanup on disconnect

Next Steps:

  1. Configure arenas in config.yml with actual coordinates

  2. Customize kits as needed

  3. Install Vault + economy plugin for money wagers

  4. Optionally install BeastTokens for token wagers

The plugin handles all operations asynchronously where appropriate and uses the reusable GUI framework for all inventory interactions!

MihneaShaff

make a language file for the messages, also make it able to setup an infinite number of arenas in game. save stats in sqlite and add placeholderapi placeholders

Kodari AI
KodariJan 12 at 8:22 am 25,429 (v2)

I’ll implement a language system, in-game arena setup, SQLite stats, and PlaceholderAPI support.

Plan:

  • Read all existing files to identify messages and data structure

  • Create language manager and messages.yml

  • Add arena setup commands with interactive setup

  • Implement SQLite stats database

  • Add PlaceholderAPI expansion

  • Update existing classes to use new systems

Now I’ll create the language system, arena setup commands, SQLite stats, and PlaceholderAPI integration.

Implementation Complete!

Added:

  • Language System: messages.yml with all messages, LanguageManager for easy message retrieval with placeholder support

  • In-game Arena Setup: /duel arena create/setspawn1/setspawn2/save/delete/list - create unlimited arenas without editing config

  • SQLite Stats: Tracks wins, losses, win rate, current streak, and best streak per player

  • PlaceholderAPI: Placeholders like %asyncduels_wins%, %asyncduels_losses%, %asyncduels_winrate%, %asyncduels_streak%, %asyncduels_best_streak%, %asyncduels_total_duels%, %asyncduels_in_duel%

  • Stats Command: /duel stats [player] to view statistics

  • Tab Completion: Full tab completion for all commands

  • Reload Command: /duel reload to reload configs and messages

All existing messages now use the language system, stats are automatically saved to SQLite, and arenas can be created in-game!

MihneaShaff

The compilation failed with this error:

code
Validation failed for compilation: Compilation failed with 3 error(s):

ERROR in src/main/java/com/asyncduels/economy/EconomyProvider.java at line 4: package me.mraxetv.beasttokens.api does not exist
import me.mraxetv.beasttokens.api.BeastTokensAPI;
                                 ^

ERROR in   src/main/java/com/asyncduels/economy/EconomyProvider.java at line 4: package me.mraxetv.beasttokens.api does not exist
  import me.mraxetv.beasttokens.api.BeastTokensAPI;
                                   ^

ERROR in src/main/java/com/asyncduels/economy/EconomyProvider.java at line 4: package me.mraxetv.beasttokens.api does not exist
import me.mraxetv.beasttokens.api.BeastTokensAPI;
                                 ^


=== COMPILATION ERROR ANALYSIS ===

FILES TO INVESTIGATE:
  - src/main/java/com/asyncduels/economy/EconomyProvider.java
  -   src/main/java/com/asyncduels/economy/EconomyProvider.java
 exceeds maximum 

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariJan 12 at 8:23 am 5,136 (v2)

I’ll analyze the compilation error and fix the missing BeastTokens dependency.

The issue is that BeastTokens API is being imported but the dependency might not be available or the import path is incorrect. I’ll fix this by making the BeastTokens integration optional and using reflection to avoid compile-time dependency.

Fixed the compilation error by:

  1. Removed the direct BeastTokens API import that was causing the compilation failure

  2. Implemented reflection-based integration to load BeastTokens at runtime if available

  3. Removed the BeastTokens dependency from build.gradle since it’s now optional and loaded via reflection

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
29 2,306
src/main/java/com/asyncduels/AsyncDuelsPlugin.java
package com.asyncduels;

import com.asyncduels.arena.ArenaManager;
import com.asyncduels.command.DuelCommand;
import com.asyncduels.config.ConfigManager;
import com.asyncduels.database.DatabaseManager;
import com.asyncduels.duel.DuelManager;
import com.asyncduels.economy.EconomyProvider;
import com.asyncduels.inventory.gui.GUIListener;
import com.asyncduels.inventory.gui.GUIManager;
import com.asyncduels.kit.KitManager;
import com.asyncduels.language.LanguageManager;
import com.asyncduels.listener.CombatListener;
import com.asyncduels.placeholder.DuelsExpansion;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class AsyncDuelsPlugin extends JavaPlugin {
    private ConfigManager configManager;
    private LanguageManager languageManager;
    private GUIManager guiManager;
    private ArenaManager arenaManager;
    private DuelManager duelManager;
    private KitManager kitManager;
    private EconomyProvider economyProvider;
    private DatabaseManager databaseManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.languageManager = new LanguageManager(this);
        this.guiManager = new GUIManager();
        this.arenaManager = new ArenaManager(this);
        this.kitManager = new KitManager(this);
        this.economyProvider = new EconomyProvider(this);
        this.databaseManager = new DatabaseManager(this);
        this.duelManager = new DuelManager(this);
        
        DuelCommand duelCommand = new DuelCommand(this);
        PluginCommand command = getCommand("duel");
        command.setExecutor(duelCommand);
        command.setTabCompleter(duelCommand);
        
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new CombatListener(this), this);
        
        arenaManager.loadArenas();
        kitManager.loadKits();
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new DuelsExpansion(this).register();
            getLogger().info("PlaceholderAPI hooked!");
        }
        
        getLogger().info("AsyncDuels has been enabled!");
    }

    @Override
    public void onDisable() {
        if (duelManager != null) {
            duelManager.shutdown();
        }
        if (databaseManager != null) {
            databaseManager.close();
        }
        getLogger().info("AsyncDuels has been disabled!");
    }
}