devil.hunter0

You are an expert Minecraft plugin developer.

Task: Generate a Spigot/Paper plugin compatible with Minecraft 1.20–1.21.10.

This plugin allows players/admins to dynamically create, remove, and edit commands, items, recipes, and functions directly in-game using prompts and menus.

Features:

  1. Command Management

- /command create → Opens a writable book INVENTORY GUI. Player types a prompt (e.g., "make a teleport command to spawn"). Plugin saves and registers the command. - /command edit <name> → Opens book INVENTORY GUI with existing definition. Player edits and saves changes. - /command remove <name> → Deletes the command from the system. - Commands persist across server restarts.

  1. Recipe Management

- /recipe create → Opens crafting table INVENTORY GUI. Player defines recipe and links it to a function/item. - /recipe edit <name> → Opens INVENTORY GUI with existing recipe for modification. - /recipe remove <name> → Deletes recipe. - Recipes persist across server restarts.

  1. Item Management

- /item create → Opens custom INVENTORY GUI. Player defines name, lore, enchantments, abilities. - /item edit <name> → Opens INVENTORY GUI with existing item for modification. - /item remove <name> → Deletes item. - Items can trigger functions (e.g., right-click ability). - Items persist across server restarts.

  1. Function Management

- /function create → Opens book INVENTORY GUI. Player writes a prompt describing the function (e.g., "heal nearby allies for 5 hearts"). - /function edit <name> → Opens INVENTORY GUI with existing function for modification. - /function remove <name> → Deletes function. - Functions can be linked to commands, items, or recipes.

  1. Plugin Creation

- /plugin create → Opens INVENTORY GUI. Player writes a prompt describing a new plugin idea. - Plugin scaffolds a new sub-plugin with its own commands, items, and recipes. - /plugin edit <name> → Modify existing sub-plugin. - /plugin remove <name> → Delete sub-plugin. - Stored in subfolder and loaded automatically.

Technical Requirements:

  • Use Java + Spigot/Paper API.
  • Include plugin.yml with dynamic command registration.
  • Use Gradle or Maven build system.
  • Store player-created content in YAML/JSON files for persistence.
  • Provide CooldownManager for abilities.
  • Include admin commands for managing created content (/command list, /recipe list, /item list, /function list, /plugin list).
  • Add safety checks (permissions, cooldowns, error handling).
Kodari AI
KodariFeb 20 at 7:27 am 39,110 (v2)

I’ll create a comprehensive dynamic content creation system with GUI-based editors for commands, items, recipes, functions, and plugins.

DynamicCraft
A powerful plugin creation framework that enables players and admins to create, edit, and manage custom commands, items, recipes, functions, and even entire sub-plugins through intuitive in-game GUIs. Features include writable book editors for command prompts, crafting table interfaces for recipe design, custom item builders with ability linking, function management with cooldown systems, and dynamic plugin scaffolding. All content persists across server restarts with comprehensive admin tools for content management.

Now I’ll create the complete plugin structure with all systems:

Now I’ll create the command classes:

Now I’ll create the GUI implementations:

Complete DynamicCraft plugin created with GUI-based editors for commands, items, recipes, functions, and plugins. Features include writable book interfaces for prompts, custom item builders with ability linking, crafting recipe designers, cooldown management, dynamic command registration, and full persistence across restarts with YAML storage.

Kodari can make mistakes. Review important code before using.
Files
src
.gitignore
build.gradle
settings.gradle
Code
35 2,909
src/main/java/com/dynamiccraft/DynamicCraft.java
package com.dynamiccraft;

import com.dynamiccraft.command.*;
import com.dynamiccraft.inventory.gui.GUIListener;
import com.dynamiccraft.inventory.gui.GUIManager;
import com.dynamiccraft.listener.ItemUseListener;
import com.dynamiccraft.manager.*;
import com.dynamiccraft.storage.DataStorage;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class DynamicCraft extends JavaPlugin {
    
    private GUIManager guiManager;
    private DynamicCommandManager dynamicCommandManager;
    private RecipeManager recipeManager;
    private ItemManager itemManager;
    private FunctionManager functionManager;
    private DynamicPluginManager dynamicPluginManager;
    private CooldownManager cooldownManager;
    private DataStorage dataStorage;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.cooldownManager = new CooldownManager();
        this.guiManager = new GUIManager();
        this.dataStorage = new DataStorage(this);
        
        this.dynamicCommandManager = new DynamicCommandManager(this);
        this.recipeManager = new RecipeManager(this);
        this.itemManager = new ItemManager(this);
        this.functionManager = new FunctionManager(this);
        this.dynamicPluginManager = new DynamicPluginManager(this);
        
        loadData();
        registerCommands();
        registerListeners();
        startAutoSave();
        
        getLogger().info("DynamicCraft has been enabled!");
    }
    
    @Override
    public void onDisable() {
        saveData();
        dynamicCommandManager.unregisterAll();
        recipeManager.unregisterAll();
        getLogger().info("DynamicCraft has been disabled!");
    }
    
    private void loadData() {
        dataStorage.loadAll();
    }
    
    private void saveData() {
        dataStorage.saveAll();
    }
    
    private void registerCommands() {
        getCommand("command").setExecutor(new CommandCommand(this));
        getCommand("recipe").setExecutor(new RecipeCommand(this));
        getCommand("item").setExecutor(new ItemCommand(this));
        getCommand("function").setExecutor(new FunctionCommand(this));
        getCommand("customplugin").setExecutor(new PluginCommand(this));
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
        Bukkit.getPluginManager().registerEvents(new ItemUseListener(this), this);
    }
    
    private void startAutoSave() {
        int interval = getConfig().getInt("settings.auto-save-interval", 300) * 20;
        Bukkit.getScheduler().runTaskTimer(this, this::saveData, interval, interval);
    }
    
    public String getMessage(String key) {
        return getConfig().getString("messages." + key, key);
    }
    
    public String getPrefix() {
        return getMessage("prefix");
    }
}