arescco.
📎 1 file 2,526 chars
📄
pasted-code-1788872734214.txt
txt 21 lines
▶
Create a complete BuildFFA minigame plugin for Spigot 1.8.8 that features a dynamic, in-game Kit Creator for administrators. The plugin must include an inventory GUI menu for players to choose these custom kits.

Dynamic Kit Creator System:
1. Command /buildffa createkit  : Allows an administrator to create a brand new kit. The plugin must scan the admin's exact current inventory (all 36 slots + armor slots), read the item types, quantities, enchantments, and item names, and save this setup directly to a kits.yml file under the provided . (Permission: buildffa.admin)
2. Command /buildffa deletekit  : Removes the specified kit from the kits.yml configuration and deletes it from the kit selection menu. (Permission: buildffa.admin)

Kit Selection Menu (GUI):
1. Command /buildffa kits (or /kits) : Opens an interactive chest GUI inventory menu. (Permission: buildffa.use)
2. The menu must dynamically read the kits.yml file and display an icon for every single custom kit created by admins. 
3. When a player clicks a kit icon in the GUI, it saves their active kit selection to memory, closes the menu, and sends a confirmation message. The selected kit will automatically be equipped the next time they drop into the arena or respawn.

Core BuildFFA Gameplay Mechanics:
1. Spawn Safety: Define a global spawn location. Inside a set radius around spawn, completely disable PvP damage, fall damage, hunger depletion, item dropping, and block placing.
2. Auto-Decaying Blocks: Outside the spawn zone, players can only place SANDSTONE blocks. Any player-placed block must automatically disappear (turn to air) after exactly 5 seconds. Natural map block breaking is completely disabled.
3. Void Instant Respawn: Monitor player Y-levels. If a player falls below a threshold (default: Y=0), instantly bypass the vanilla red death screen, clear active potion effects, teleport them back to the spawn location, and clear their inventory to equip their selected custom kit.
4. Kill Streak & Combat Logs: Track kills and deaths. On a kill, grant the killer 1x Golden Apple, send a custom action bar message, and broadcast a death message. If a player logs out while in combat (hit in the last 10 seconds), award the kill to the last attacker.

Setup Admin Commands:
- /buildffa setspawn : Sets the global spawn point location. (Permission: buildffa.admin)
- /buildffa setheight  : Sets the minimum Y-value before a player is reset by the void. (Permission: buildffa.admin)
Kodari AI
KodariSep 8 at 1:12 pm 2
BuildFFAKitCreator
A comprehensive BuildFFA minigame plugin for Spigot 1.8.8 featuring a dynamic Kit Creator system. Administrators can create kits by scanning their current inventory (items, armor, enchantments, names) into kits.yml via /buildffa createkit, and delete them with /buildffa deletekit. Players access a GUI menu via /buildffa kits to select saved kits, which auto-equip on spawn or respawn. Core gameplay includes spawn safety zones with disabled PvP, fall damage, hunger, item dropping, and block placing; auto-decaying SANDSTONE blocks outside spawn that vanish after 5 seconds; void instant respawn below configurable Y-level with kit re-equipment; kill streak tracking with Golden Apple rewards, action bar messages, death broadcasts, and combat log kill attribution. Admin commands set spawn location and void height threshold.
  1. Create the Gradle project and plugin metadata for Spigot 1.8.8.

  2. Add kit persistence, dynamic kit GUI, commands, and configuration.

  3. Add gameplay management for spawn protection, decaying blocks, void resets, combat tracking, kills, and combat logs.

  4. Add utility classes and register all managers/listeners through the main plugin class.

Implemented the complete BuildFFA plugin for Spigot 1.8.8.

Included:

  • /buildffa createkit <name>

  • /buildffa deletekit <name>

  • /buildffa kits and /kits

  • /buildffa setspawn

  • /buildffa setheight <Y>

  • Dynamic kit GUI with pagination

  • Kit persistence in kits.yml

  • Inventory and armor-slot kit capture

  • Enchantment, item-name, and quantity preservation

  • Spawn-zone PvP, fall damage, hunger, dropping, and block-placement protection

  • Sandstone-only building outside spawn

  • Five-second block decay

  • Void teleport and kit reset

  • Kill/death tracking

  • Golden Apple kill rewards

  • Action bar kill messages

  • Combat logging punishments

  • Respawn kit equipping

  • Configurable spawn radius, void height, combat timeout, and decay duration

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
12 935
src/main/java/com/kodari/buildffa/BuildFFAPlugin.java
package com.kodari.buildffa;

import com.kodari.buildffa.command.BuildFFACommand;
import com.kodari.buildffa.game.GameManager;
import com.kodari.buildffa.gui.KitMenu;
import com.kodari.buildffa.kit.KitManager;
import com.kodari.buildffa.listener.GameListener;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;
import org.bukkit.plugin.java.JavaPlugin;

public class BuildFFAPlugin extends JavaPlugin {
    private KitManager kitManager;
    private GameManager gameManager;
    private KitMenu kitMenu;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("kits.yml", false);

        kitManager = new KitManager(this);
        gameManager = new GameManager(this, kitManager);
        kitMenu = new KitMenu(this, kitManager, gameManager);

        getServer().getPluginManager().registerEvents(new GameListener(this, gameManager), this);

        BuildFFACommand command = new BuildFFACommand(this, kitManager, gameManager, kitMenu);
        getCommand("buildffa").setExecutor(command);
        getCommand("kits").setExecutor(command);
    }

    @Override
    public void onDisable() {
        if (kitManager != null) {
            kitManager.save();
        }
    }

    public KitManager getKitManager() {
        return kitManager;
    }

    public GameManager getGameManager() {
        return gameManager;
    }

    public KitMenu getKitMenu() {
        return kitMenu;
    }

    public String message(String key, String... replacements) {
        String value = getConfig().getString("messages." + key, key);
        for (int i = 0; i + 1 < replacements.length; i += 2) {
            value = value.replace("{" + replacements[i] + "}", replacements[i + 1]);
        }
        String prefix = getConfig().getString("messages.prefix", "");
        return ChatColor.translateAlternateColorCodes('&', prefix + value);
    }

    public void send(CommandSender sender, String key, String... replacements) {
        sender.sendMessage(message(key, replacements));
    }
}