ahmedgaming786656-ai
📎 1 file 3,619 chars
📄
pasted-code-1779054626000.txt
txt 210 lines
▶
Create a professional Minecraft Tournament Plugin for Paper/Spigot servers.

Plugin Name: Tournament
Author: PRIME_AHMED

━━━━━━━━━━━━━━━
📌 Main System
━━━━━━━━━━━━━━━

The plugin should allow admins to create automatic PvP tournaments with arena setup, automatic kit system, inventory save/restore system, countdowns, and command restrictions.

━━━━━━━━━━━━━━━
⚙️ Arena Setup System
━━━━━━━━━━━━━━━

Admin Commands:

/tournament setspawn
→ Sets tournament lobby location.
/tournament setarena
→ Sets fighting arena location.
/tournament setexit
→ Sets exit/spawn location after death or tournament end.

All locations must save automatically in config.yml.

━━━━━━━━━━━━━━━
🎮 Tournament System
━━━━━━━━━━━━━━━

Command:
/tournament start 
Kodari AI
KodariMay 18 at 11:49 am 17,571 (v2)

I’ll create a professional Tournament plugin with arena setup, automatic kit system, inventory save/restore, and command restrictions.

Tournament
A comprehensive PvP tournament system for Minecraft servers with automatic arena management, configurable kits, inventory save/restore functionality, timed countdowns, and command restrictions. Features include lobby/arena/exit spawn settings, automatic PvP enabling, death handling, winner detection, configurable rewards, PlaceholderAPI support, and ActionBar/Title notifications. Optimized for Paper/Spigot 1.20+ servers.

Tournament Plugin Created Successfully! ✅

The plugin includes:

✅ Arena System - /tournament setspawn/setarena/setexit commands
✅ Tournament Management - /tournament start <time> with 30s/20m/1h support
✅ Join System - /tournament join with automatic teleportation
✅ Inventory Save/Restore - Complete state preservation (inventory, armor, offhand, XP, health, hunger, effects)
✅ Kit System - Configurable kits with armor, items, offhand, potions, enchantments
✅ Fight System - Automatic PvP, death handling, winner detection
✅ Rewards - Execute console commands for winners
✅ Command Blocking - Prevent specific commands during tournament
✅ ActionBar/Titles - Countdown displays and notifications
✅ Sound Effects - Configurable sounds for all events
✅ PlaceholderAPI - Soft dependency support
✅ Permissions - tournament.admin and tournament.join

Build with: ./gradlew build (outputs to build/libs/Tournament-1.0.0.jar)

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
16 1,449
src/main/java/com/primeahmed/tournament/Tournament.java
package com.primeahmed.tournament;

import com.primeahmed.tournament.commands.TournamentCommand;
import com.primeahmed.tournament.listeners.CommandBlockListener;
import com.primeahmed.tournament.listeners.PlayerDeathListener;
import com.primeahmed.tournament.listeners.PlayerQuitListener;
import com.primeahmed.tournament.managers.*;
import org.bukkit.Bukkit;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class Tournament extends JavaPlugin {
    private ConfigManager configManager;
    private ArenaManager arenaManager;
    private InventoryManager inventoryManager;
    private KitManager kitManager;
    private TournamentManager tournamentManager;
    
    @Override
    public void onEnable() {
        configManager = new ConfigManager(this);
        arenaManager = new ArenaManager(configManager);
        inventoryManager = new InventoryManager();
        kitManager = new KitManager(configManager);
        tournamentManager = new TournamentManager(this, configManager, arenaManager, 
                                                  inventoryManager, kitManager);
        
        registerCommands();
        registerListeners();
        
        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            getLogger().info("PlaceholderAPI found and hooked!");
        }
        
        getLogger().info("Tournament plugin has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (tournamentManager != null) {
            tournamentManager.reset();
        }
        
        getLogger().info("Tournament plugin has been disabled!");
    }
    
    private void registerCommands() {
        TournamentCommand tournamentCommand = new TournamentCommand(
            tournamentManager, arenaManager, configManager
        );
        
        getCommand("tournament").setExecutor(tournamentCommand);
        getCommand("tournament").setTabCompleter(tournamentCommand);
    }
    
    private void registerListeners() {
        PluginManager pm = Bukkit.getPluginManager();
        
        pm.registerEvents(new PlayerDeathListener(tournamentManager), this);
        pm.registerEvents(new PlayerQuitListener(tournamentManager), this);
        pm.registerEvents(new CommandBlockListener(tournamentManager, configManager), this);
    }
    
    public TournamentManager getTournamentManager() {
        return tournamentManager;
    }
    
    public ConfigManager getConfigManager() {
        return configManager;
    }
    
    public ArenaManager getArenaManager() {
        return arenaManager;
    }
    
    public InventoryManager getInventoryManager() {
        return inventoryManager;
    }
    
    public KitManager getKitManager() {
        return kitManager;
    }
}