Generating Minecraft Plugins
Markdown--- name: generating-minecraft-plugins description: Generates complete, production-quality Minecraft server plugins (Paper/Spigot/Bukkit/Velocity/BungeeCord) with full Java source, build files, and configs. Use when the user asks to make, create, build, write, or generate a Minecraft plugin — including specific plugin types like economy, PvP, skyblock, prison, factions, bedwars, kitpvp, lifesteal, RPG, hub/lobby plugins, or any request for Java source files targeting a Minecraft server. Always outputs complete working code, never stubs or pseudocode. --- # Generating Minecraft Plugins Produce complete, compilable plugin projects matching the quality of premium SpigotMC/BuiltByBit plugins ($20-$50 tier). Draws on architecture patterns from ShopGUI+, LuckPerms, EssentialsX, CMI, Citizens, MythicMobs, and BattlePass.
For any plugin request, immediately determine:
- Server type archetype (survival, skyblock, prison, factions, lifesteal, kitpvp, bedwars, hub, RPG, or generic)
- Feature modules needed (economy, GUI, database, custom enchants, crates, etc.)
- Integrations to soft-depend on (Vault, LuckPerms, PlaceholderAPI, Citizens...)
Then generate the full file tree — never partial output. Minimum viable plugin always includes: build.gradle.kts, plugin.yml, config.yml, messages.yml, main class, at least one manager, at least one command, at least one listener, ItemBuilder util.
Progress:
- [ ] Identify server archetype and auto-include its standard feature set
- [ ] Identify explicit feature requests beyond the archetype defaults
- [ ] Select third-party integrations (soft-depend, check-before-hook pattern)
- [ ] Generate build.gradle.kts (Shadow JAR, relocations, Java 21 toolchain)
- [ ] Generate plugin.yml (commands, permissions, softdepend)
- [ ] Generate config.yml + messages.yml (fully commented, MiniMessage strings)
- [ ] Generate main class (onEnable order: config → db → managers → commands → listeners)
- [ ] Generate one Manager class per system
- [ ] Generate Command classes (CommandExecutor + TabCompleter combined)
- [ ] Generate Listener classes (separate from managers)
- [ ] Generate util classes (ItemBuilder minimum)
- [ ] Verify checklist below is 100% satisfied before returning output
- Paper API 1.20.4, Java 21. Never target legacy Bukkit unless explicitly asked.
- Adventure/MiniMessage only. Never
ChatColoror§codes. UseComponent,<red>,<gradient>, etc. - Async everything DB-related.
CompletableFuture.supplyAsync(...)for queries, hop back to main thread viaBukkit.getScheduler().runTask(...)for any Bukkit API calls in the callback. - HikariCP for MySQL, opened in
onEnable, closed inonDisable. SQLite acceptable for single-server small plugins. - One Manager class per system (
EconomyManager,GUIManager,DatabaseManager). Constructor injection of the plugin instance — neverJavaPlugin.getPlugin(). - No static state except the plugin singleton.
- Config wrapper class (
PluginConfig) — never scatter rawgetConfig().getX()calls through business logic. - Gradle Kotlin DSL + Shadow plugin, relocate all shaded dependencies to avoid classpath collisions with other plugins.
- Soft-depend, don't hard-depend on optional integrations (Vault, LuckPerms, PlaceholderAPI, Citizens, MythicMobs, ItemsAdder). Always null-check /
isPluginEnabledbefore hooking.
| Archetype | Auto-included systems |
|---|---|
| Survival | land claiming, chest protection, homes, spawn, TPA, death chest, Vault economy, player shops |
| Skyblock | island CRUD, island levels, upgrades, custom generators, coop, challenges, top leaderboard |
| Prison | mines w/ auto-reset, auto-sell, rank progression A-Z+Prestige, rankup GUI, tokens, custom enchants |
| Factions | claim/power system, roles, ally/enemy/truce, faction home/chat/vault, raid shield timer |
| Lifesteal | heart system (10 base hearts=20HP), kill=+1 heart, death=-1 heart, elimination, heart crystal item, revival |
| KitPvP | kit GUI w/ cooldowns, killstreaks, bounties, combat tag, stats (K/D/KDR), leaderboards |
| Bedwars | arena setup mode, bed destruction, resource generators, shop NPC, team upgrades, game state machine |
| Hub/Lobby | MOTD, server selector GUI, NPC selectors, hotbar items, lobby protection, cosmetics, announcements |
| RPG | class system, XP/leveling, skill trees, mana, quests, loot tables, parties, STR/DEX/INT stats |
When request matches an archetype, generate its full feature set even if the user only named the archetype (e.g. "make me a skyblock plugin" → generate all skyblock systems).
-
build.gradle.kts— Shadow JAR, all deps, relocations -
src/main/resources/plugin.yml— commands, permissions, softdepend -
src/main/resources/config.yml— commented, all tunables -
src/main/resources/messages.yml— all player-facing strings, MiniMessage format - Main class — clean onEnable/onDisable, correct init order
-
config/PluginConfig.java— config wrapper -
database/DatabaseManager.java— if persistence needed, HikariCP-based - One
manager/[Feature]Manager.javaper system - One
command/[Name]Command.javaper command group (Executor + TabCompleter) - One
listener/[Name]Listener.javaper event group -
util/ItemBuilder.java
If any box is unchecked, the output is incomplete — keep generating.
Example 1:
Input: "make me a lifesteal plugin"
Output: Full project with HeartManager (PDC + MySQL heart storage), HeartCrystalListener (custom NBT item use), EliminationManager (ban-on-zero-hearts with configurable duration), /hearts and /revive commands, config.yml with max-hearts, starting-hearts, elimination-ban-duration, messages.yml with MiniMessage strings, build.gradle.kts with Paper API + HikariCP, plugin.yml with permissions for revive/give.
Example 2:
Input: "generate a ShopGUI-style economy plugin with Vault support"
Output: EconomyManager wrapping Vault's Economy, ShopManager loading item categories from YAML, ShopGUI (extends AbstractGui) with buy/sell click handling, GuiListener centralizing InventoryClickEvent, ItemBuilder util, config.yml defining shop categories/prices, softdepend on Vault in plugin.yml, PlaceholderAPI expansion exposing %myplugin_balance%.
- Always include a
/plugin reloadand/plugin debugcommand — expected by server admins. - Expose at least 3 PlaceholderAPI placeholders if PlaceholderAPI is soft-depended.
- Separate
messages.ymlfromconfig.ymlfor easy translation. - Comment every config.yml value inline explaining units and defaults.
- Use
ItemBuilderfor all constructedItemStacks — never inlineItemMetamutation scattered through code. - For Folia requests, replace all
Bukkit.getScheduler()calls withRegionScheduler/AsyncScheduler/GlobalRegionSchedulerequivalents. - Store custom item data via
PersistentDataContainer, never lore-string parsing for logic.
- Never output pseudocode,
// TODO, or// implement this later— every method must be fully implemented. - Never use deprecated
ChatColor/§— MiniMessage/Adventure only. - Never block the main thread with JDBC calls — always async with a main-thread callback for Bukkit API touches.
- Never hard-depend on optional plugins (Vault, LuckPerms, etc.) — soft-depend and null-check.
- Never omit
build.gradle.ktsorplugin.yml— a plugin without these does not run. - Never scatter
getConfig().getString(...)through business logic — always go through the config wrapper class. - Never generate a partial file tree when a server archetype implies more systems than explicitly requested.