Sayak Sabal

Create a production-ready Minecraft Java plugin called GemFusion for Paper 1.21.x.

Core Concept

Create a unique Gem Fusion System where players can collect different types of custom gems and combine them to create stronger and rarer gems.

Gem Tiers

Create 6 gem tiers:

  • Common Gem
  • Uncommon Gem
  • Rare Gem
  • Epic Gem
  • Legendary Gem
  • Mythic Gem

Each tier should have a unique item name, lore, rarity color, and custom model data support.

Gem Types

Add different gem types with unique purposes:

  • Ruby — Attack
  • Sapphire — Defense
  • Emerald — Mining
  • Amethyst — Experience
  • Topaz — Speed
  • Obsidian Gem — Special abilities

Allow the system to be easily expanded with more gem types through configuration files.

Fusion System

Create a GUI-based fusion menu.

Players should be able to:

  1. Open "/gemfusion"
  2. Place compatible gems into the fusion slots.
  3. See a live preview of the resulting gem.
  4. Click a FUSE button.
  5. Receive the upgraded gem if the recipe is valid.

Example:

  • 3 Common Ruby → 1 Uncommon Ruby
  • 3 Uncommon Ruby → 1 Rare Ruby
  • 3 Rare Ruby → 1 Epic Ruby
  • 3 Epic Ruby → 1 Legendary Ruby
  • 3 Legendary Ruby → 1 Mythic Ruby

Make the number of required gems configurable.

GUI

Create a clean, modern GUI with:

  • Fusion slots
  • Result slot
  • FUSE button
  • Cancel button
  • Information item
  • Decorative glass panes

Prevent players from taking items from protected GUI slots.

Add configurable GUI titles, slots, item names, lore, and sounds.

Gem Abilities

Higher-tier gems should provide stronger passive effects.

Examples:

  • Ruby → increased attack damage
  • Sapphire → resistance
  • Emerald → faster mining
  • Amethyst → bonus XP
  • Topaz → speed
  • Obsidian Gem → special configurable effect

Effects should only work while the gem is equipped in a configurable slot, such as the offhand or a dedicated gem slot.

Gem Discovery

Add multiple ways to obtain gems:

  • Mining
  • Mob drops
  • Chests
  • Custom loot tables
  • Quests
  • Admin commands

All chances and rewards must be configurable.

Commands

Add:

"/gemfusion" — Open fusion GUI "/gems" — View owned gems "/gem give <player> <gem> <tier> <amount>" — Give gems "/gem reload" — Reload configuration "/gem info <gem>" — Show gem information

Add proper permission nodes for admin commands.

Economy Integration

Optionally support Vault.

Allow a configurable fusion fee, for example: 3 Rare Gems + $500 → 1 Epic Gem

Allow the fusion cost to be enabled/disabled in config.

Effects & Animations

When fusion succeeds:

  • Play configurable sound
  • Display particles
  • Show a success message
  • Add a short GUI animation
  • Optionally broadcast Mythic-tier fusion to the server

When fusion fails:

  • Play an error sound
  • Display an appropriate message
  • Return all input items safely

Anti-Exploit & Safety

Make the plugin secure against:

  • Item duplication
  • Shift-click exploits
  • Dragging items into protected slots
  • Inventory closing exploits
  • Reload-related item loss
  • Server crashes during fusion

Always safely return input items when the GUI is closed or interrupted.

Configuration

Use YAML configuration files.

Create:

  • "config.yml"
  • "gems.yml"
  • "recipes.yml"
  • "messages.yml"
  • "gui.yml"

Everything important should be configurable without modifying Java source code.

Compatibility

Target:

  • Paper 1.21.x
  • Java 25
  • Vault optional
  • PlaceholderAPI optional

Use Adventure API for modern messages and MiniMessage formatting where appropriate.

Code Quality

Use clean, modular Java code with separate managers/classes for:

  • GemManager
  • FusionManager
  • GUIManager
  • RecipeManager
  • EffectManager
  • CommandManager
  • ConfigManager

Do not put everything into one main class.

Provide:

  1. Complete source code
  2. "plugin.yml"
  3. All configuration files
  4. Maven or Gradle build configuration
  5. Installation instructions
  6. Example gem recipes
  7. Permission list
  8. Explanation of how to add new gems and tiers

The final plugin should compile successfully and be ready to put into a Paper 1.21.x server.

Kodari AI
KodariSep 8 at 3:05 pm 2
GemFusion
A comprehensive Paper 1.21.x plugin implementing a gem fusion system with six tiers (Common to Mythic) and six gem types (Ruby, Sapphire, Emerald, Amethyst, Topaz, Obsidian). Features a GUI-based fusion menu with live previews, configurable recipes, passive effects while equipped, multiple discovery methods (mining, mobs, chests), admin commands, optional Vault economy integration, and full YAML configuration. Includes anti-exploit protections, particle/sound effects, and modular architecture with dedicated managers for gems, fusion, recipes, effects, and configuration.
  1. Build the Gradle/Paper project and configuration resources.

  2. Add modular gem, recipe, fusion, GUI, effect, discovery, and command services.

  3. Add secure inventory handling, reload/disable item recovery, permissions, and documentation.

Created the GemFusion Paper 1.21.x project with:

  • Gradle build configuration targeting Java 25

  • plugin.yml with commands and permissions

  • Configurable YAML files:

    • config.yml

    • gems.yml

    • recipes.yml

    • messages.yml

    • gui.yml

  • Modular managers for gems, recipes, fusion, GUI, effects, discovery, commands, and configuration

  • Six gem tiers and six configurable gem types

  • Configurable fusion recipes and fusion requirements

  • Secure GUI input handling with protected slots, drag prevention, and item recovery

  • Optional Vault economy fusion fees

  • Mining, mob-drop, chest, and configurable loot discovery

  • Passive equipped-gem effects

  • Fusion sounds, particles, messages, animation, and Mythic broadcasts

  • /gemfusion, /gems, and /gem give|reload|info

  • Installation and extension documentation in README.md

Build with:

Shell
./gradlew build

Install the resulting JAR from build/libs/ into the server’s plugins directory.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
README.md
settings.gradle
Code
24 1,102
src/main/java/com/kodari/gemfusion/GemFusionPlugin.java
package com.kodari.gemfusion;

import com.kodari.gemfusion.command.CommandManager;
import com.kodari.gemfusion.config.ConfigManager;
import com.kodari.gemfusion.discovery.DiscoveryListener;
import com.kodari.gemfusion.effect.EffectManager;
import com.kodari.gemfusion.fusion.FusionManager;
import com.kodari.gemfusion.fusion.RecipeManager;
import com.kodari.gemfusion.gem.GemManager;
import com.kodari.gemfusion.gui.GUIManager;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;

public final class GemFusionPlugin extends JavaPlugin {
    private ConfigManager configManager;
    private GemManager gemManager;
    private RecipeManager recipeManager;
    private FusionManager fusionManager;
    private GUIManager guiManager;
    private EffectManager effectManager;
    private Economy economy;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        configManager = new ConfigManager(this);
        configManager.load();
        gemManager = new GemManager(this, configManager);
        gemManager.load();
        recipeManager = new RecipeManager(configManager);
        recipeManager.load();
        economy = setupEconomy();
        fusionManager = new FusionManager(this, configManager, gemManager, recipeManager, economy);
        guiManager = new GUIManager(this, configManager, fusionManager);
        effectManager = new EffectManager(this, configManager, gemManager);
        Bukkit.getPluginManager().registerEvents(guiManager, this);
        Bukkit.getPluginManager().registerEvents(effectManager, this);
        Bukkit.getPluginManager().registerEvents(new DiscoveryListener(this, configManager, gemManager), this);
        new CommandManager(this, configManager, gemManager, guiManager).register();
        effectManager.start();
        getLogger().info("GemFusion enabled with " + gemManager.getDefinitions().size() + " gem types.");
    }

    @Override
    public void onDisable() {
        if (guiManager != null) {
            guiManager.closeAll();
        }
    }

    private Economy setupEconomy() {
        if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
            return null;
        }
        RegisteredServiceProvider<Economy> registration = Bukkit.getServicesManager().getRegistration(Economy.class);
        return registration == null ? null : registration.getProvider();
    }

    public void reloadPlugin() {
        guiManager.closeAll();
        reloadConfig();
        configManager.load();
        gemManager.load();
        recipeManager.load();
    }

    public ConfigManager configs() { return configManager; }
    public GemManager gems() { return gemManager; }
    public RecipeManager recipes() { return recipeManager; }
    public FusionManager fusion() { return fusionManager; }
    public GUIManager gui() { return guiManager; }
}