Rapidz

PROJECT: Divine Enchantments

Minecraft Plugin — Paper 1.21.4

Act as an expert Minecraft Java Plugin Developer, specializing in Paper API, advanced enchantment systems, Minecraft server mechanics, and performance optimization.

Build a complete, production-ready Minecraft plugin for Paper 1.21.4, inspired by AdvancedEnchantments, but significantly more advanced, feature-rich, customizable, and user-friendly.

The plugin should feel like a premium commercial plugin.

  1. CORE ENCHANTMENT SYSTEM

Create a completely custom enchantment system with:

  • 100+ unique custom enchantments.
  • Multiple enchantment rarities:

- Common - Uncommon - Rare - Epic - Legendary - Mythical - Divine - Exclusive

  • Custom enchantment levels (I–X or configurable).
  • Custom enchantment descriptions and lore.
  • Custom enchantment activation messages.
  • Custom activation particles and sounds.
  • Configurable activation chances.
  • Enchantment cooldowns.
  • Enchantment conflicts.
  • Enchantment combinations and synergies.
  • Configurable maximum enchantments per item.
  • Support for combining custom enchantments.
  • Custom enchantment books.
  1. ADVANCED ENCHANTMENT EFFECTS

Create a powerful effect engine supporting:

Combat

  • Lifesteal
  • Double Strike
  • Triple Strike
  • Rage
  • Critical Strike
  • Bleed
  • Poison
  • Wither
  • Thunder Strike
  • Execute
  • Vampire
  • Soulbound
  • Berserk
  • Frozen Touch
  • Armor Breaker
  • Revenge
  • Dodge
  • Reflection
  • Phoenix
  • Last Stand

Mining

  • Vein Miner
  • Explosive
  • Jackhammer
  • Auto Smelt
  • Telepathy
  • Magnetic
  • Haste
  • Ore Discovery
  • Excavation
  • Tunnel
  • Lucky Miner

Farming

  • Harvester
  • Replant
  • Auto Sell (configurable integration)
  • Farmer's Luck
  • Double Drops
  • Triple Drops
  • Crop Magnet

Movement

  • Speed Boost
  • Jump Boost
  • Feather Fall
  • Dolphin
  • Swift Sneak
  • Dash
  • Double Jump
  • No Fall

Defensive

  • Regeneration
  • Protection Aura
  • Anti Knockback
  • Guardian
  • Reflect Damage
  • Absorption
  • Fire Immunity
  • Water Breathing

All effects must have configurable parameters and activation conditions.

  1. CUSTOM EFFECT ENGINE

Create an expandable effect engine that allows developers and administrators to create new enchantments without modifying Java source code.

Support configurable triggers such as:

  • ATTACK
  • DEFEND
  • KILL
  • DEATH
  • BLOCK_BREAK
  • BLOCK_PLACE
  • PROJECTILE_HIT
  • PROJECTILE_SHOOT
  • PLAYER_JUMP
  • PLAYER_SNEAK
  • PLAYER_MOVE
  • RIGHT_CLICK
  • LEFT_CLICK
  • CONSUME
  • FISHING
  • EXPERIENCE_GAIN

Support effect actions such as:

  • DAMAGE
  • HEAL
  • POTION_EFFECT
  • LIGHTNING
  • EXPLOSION
  • PARTICLES
  • SOUND
  • FIRE
  • TELEPORT
  • PUSH
  • PULL
  • GIVE_ITEM
  • DROP_ITEM
  • EXECUTE_COMMAND
  • MESSAGE
  • BROADCAST
  • APPLY_COOLDOWN

Allow multiple effects to execute from one enchantment.

  1. ENCHANTMENT BOOK SYSTEM

Create a complete custom book system.

Each book should have:

  • Custom name.
  • Custom texture using resource-pack CustomModelData where supported.
  • Rarity.
  • Enchantment.
  • Enchantment level.
  • Success percentage.
  • Destroy percentage.
  • Protection scroll compatibility.

Include:

  • Success Scrolls.
  • Protection Scrolls.
  • White Scrolls.
  • Random Enchantment Books.
  • Mystery Books.
  • Soul Books.
  • Upgrade Books.
  • Enchantment Removal Books.
  1. CUSTOM GUI SYSTEM

Create beautiful, modern inventory GUIs.

Required menus:

  1. Enchantment Menu
  2. Enchantment Information Menu
  3. Enchantment Book Menu
  4. Enchantment Removal Menu
  5. Enchantment Upgrade Menu
  6. Enchantment Discovery Menu
  7. Admin Enchantment Editor
  8. Enchantment Shop
  9. Blacklist Management

GUI requirements:

  • Fully configurable layouts.
  • Custom item icons.
  • Custom colors and formatting.
  • Pagination.
  • Back buttons.
  • Sounds.
  • Click actions.
  • Confirmation menus.
  • PlaceholderAPI support.
  1. ADMIN COMMANDS

Implement:

/ce help /ce reload /ce givebook <player> <enchantment> <level> /ce giveitem <player> <enchantment> <level> /ce enchant <enchantment> <level> /ce remove <enchantment> /ce list /ce info <enchantment> /ce editor /ce book <player> <rarity> /ce randombook <player> /ce debug /ce version

Include tab completion and detailed permission management.

  1. PLAYER COMMANDS

/enchants /enchants info <enchantment> /enchants list /enchants discover

Commands should have configurable aliases.

  1. CONFIGURATION SYSTEM

Everything must be configurable through YAML files.

Suggested structure:

plugins/UltimateEnchants/ config.yml enchants/ combat.yml mining.yml farming.yml movement.yml defensive.yml books.yml rarities.yml gui/ main.yml editor.yml books.yml messages.yml cooldowns.yml blacklist.yml

Administrators should be able to create, edit, disable, and remove enchantments without recompiling the plugin.

  1. INTEGRATIONS

Support:

  • PlaceholderAPI
  • Vault
  • WorldGuard
  • WorldEdit (optional)
  • EssentialsX
  • MythicMobs
  • ExcellentEnchants (optional compatibility consideration)

Make integrations optional so the plugin works without them.

  1. PERFORMANCE AND COMPATIBILITY

Target:

  • Paper 1.21.4
  • Java 21
  • Maven build system

Requirements:

  • Use modern Paper API.
  • Avoid NMS and unnecessary reflection.
  • Avoid expensive repeating tasks.
  • Use event-driven architecture.
  • Optimize enchantment lookups.
  • Use asynchronous operations only where safe.
  • Prevent item duplication exploits.
  • Prevent enchantment stacking exploits.
  • Properly handle player logout and death.
  • Avoid memory leaks.
  • Support multiplayer servers with high player counts.
  1. CUSTOMIZATION

Allow complete customization of:

  • Enchantment names.
  • Lore.
  • Colors.
  • Rarities.
  • Activation chances.
  • Cooldowns.
  • Effects.
  • Sounds.
  • Particles.
  • Levels.
  • Conflicts.
  • Permissions.
  • World restrictions.
  • Region restrictions.
  • Blacklisted items.
  • Blacklisted worlds.
  1. UNIQUE PREMIUM FEATURES

Add features that make this plugin better than AdvancedEnchantments:

Enchantment Evolution Enchants gain XP through usage and can evolve into stronger versions.

Enchantment Fusion Combine compatible enchantments to create special hybrid enchantments.

Enchantment Awakening Rare books can awaken hidden abilities on eligible equipment.

Soulbound Enchantments Special enchantments that have configurable death-retention mechanics.

Enchantment Mastery Track enchantment usage statistics and player progression.

Dynamic Enchantment Discovery Players discover rare enchantments through configurable gameplay activities.

Custom Enchantment Sets Wearing multiple pieces with compatible enchantments unlocks set bonuses.

Enchantment Runes Allow players to add extra effects to already enchanted equipment.

  1. DEVELOPMENT REQUIREMENTS

Do not generate a fake implementation or a plugin containing only commands and GUI placeholders.

Every advertised enchantment must have a functional implementation.

Use clean, modular Java architecture.

Separate:

  • Enchantment registration
  • Effect engine
  • Trigger handling
  • Item management
  • Book management
  • GUI management
  • Configuration
  • Integrations
  • Commands
  • Permissions

Include proper error handling and logging.

  1. FINAL DELIVERABLES

Generate:

  1. Complete Java source code.
  2. Maven pom.xml.
  3. plugin.yml.
  4. All default YAML configurations.
  5. All functional enchantments.
  6. All GUI implementations.
  7. Installation instructions.
  8. Configuration documentation.
  9. Admin command documentation.
  10. A compiled, working JAR file.

IMPORTANT INSTRUCTIONS

  • Never leave important features as TODO comments.
  • Never create fake enchantments that do nothing.
  • Never omit required classes.
  • Never use deprecated APIs unnecessarily.
  • Ensure the plugin compiles successfully against Paper 1.21.4.
  • Test for common duplication and exploit issues.
  • If the project is too large to generate at once, develop it in clearly defined phases while maintaining a working, compilable project after each phase.
  • Prioritize functionality, stability, extensibility, and performance over unnecessary complexity.

The final result should be a premium custom enchantment plugin that can genuinely compete with and surpass AdvancedEnchantments

Kodari AI
KodariNov 9 at 11:46 am 3
DivineEnchantments
Advanced custom enchantment plugin for Paper 1.21.4 with 100+ functional enchantments across combat, mining, farming, movement, and defensive categories. Features a configurable effect engine supporting 16 trigger types and 16 action types, complete book system with success/destroy/protection mechanics, 9 fully configurable GUIs with pagination and PlaceholderAPI support, enchantment evolution/fusion/awakening systems, soulbound mechanics, set bonuses, and runes. Includes admin/player commands with tab completion, YAML-driven configuration for all enchantments/rarities/books/cooldowns, optional Vault/WorldGuard/MythicMobs integrations, and event-driven architecture optimized for high-player-count servers with anti-exploit protections.

I’ll build the event-driven enchantment core first: configurable definitions, persistent item data, custom books, combat effects, and commands. I’ll be explicit about any requested systems that remain unimplemented.

Created a starter implementation, not the complete premium plugin requested.

It includes six configurable combat enchantments, custom books, item limits and conflicts, cooldowns, and basic admin commands. Edit enchants.yml to change their effects and config.yml for book chances and item restrictions. Install the compiled JAR in the server’s plugins folder and restart.

Still missing: most enchantments and triggers, all requested GUIs and integrations, the advanced book types and premium progression systems, granular permissions, and the full documentation. The project has not been compiled or tested here, so a working JAR is not yet verified.

To build it in Kodari, click Compile in the top bar, then Compile in the window. When it succeeds, click Download.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
5 385
src/main/java/com/kodari/divine/DivineEnchantments.java
package com.kodari.divine;

import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.attribute.Attribute;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.LivingEntity;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import java.io.File;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ThreadLocalRandom;

public final class DivineEnchantments extends JavaPlugin implements Listener, TabExecutor {
    private final Map<String, Definition> definitions = new LinkedHashMap<>();
    private final Map<UUID, Map<String, Long>> cooldowns = new HashMap<>();
    private NamespacedKey enchantKey;
    private NamespacedKey bookKey;
    private NamespacedKey loreKey;

    private record Definition(String id, String name, String description, String rarity, int maxLevel,
                              String trigger, double chance, long cooldown, List<String> items,
                              List<String> conflicts, List<String> effects) { }

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("enchants.yml", false);
        enchantKey = new NamespacedKey(this, "enchantments");
        bookKey = new NamespacedKey(this, "book");
        loreKey = new NamespacedKey(this, "lore_count");
        loadDefinitions();
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("ce").setExecutor(this);
        getCommand("ce").setTabCompleter(this);
        getCommand("enchants").setExecutor(this);
        getCommand("enchants").setTabCompleter(this);
    }

    private void loadDefinitions() {
        definitions.clear();
        ConfigurationSection root = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "enchants.yml")).getConfigurationSection("enchants");
        if (root == null) return;
        for (String id : root.getKeys(false)) {
            ConfigurationSection s = root.getConfigurationSection(id);
            if (s == null || !s.getBoolean("enabled", true)) continue;
            String key = id.toLowerCase(Locale.ROOT);
            if (!key.matches("[a-z0-9_]+")) {
                getLogger().warning("Invalid enchantment id: " + id);
                continue;
            }
            definitions.put(key, new Definition(key, s.getString("name", id), s.getString("description", ""),
                    s.getString("rarity", "COMMON"), Math.max(1, s.getInt("max-level", 5)),
                    s.getString("trigger", "ATTACK").toUpperCase(Locale.ROOT),
                    Math.max(0, Math.min(100, s.getDouble("chance", 100))),
                    Math.max(0, s.getLong("cooldown-seconds", 0)) * 1000L,
                    s.getStringList("items"), s.getStringList("conflicts"), s.getStringList("effects")));
        }
    }

    private String color(String text) { return ChatColor.translateAlternateColorCodes('&', text); }

    private Map<String, Integer> read(ItemStack item) {
        Map<String, Integer> result = new LinkedHashMap<>();
        if (item == null || !item.hasItemMeta()) return result;
        String raw = item.getItemMeta().getPersistentDataContainer().get(enchantKey, PersistentDataType.STRING);
        if (raw == null) return result;
        for (String entry : raw.split(";")) {
            String[] parts = entry.split(":", 2);
            if (parts.length != 2) continue;
            try { result.put(parts[0], Integer.parseInt(parts[1])); } catch (NumberFormatException ignored) { }
        }
        return result;
    }

    private void write(ItemStack item, Map<String, Integer> enchants) {
        ItemMeta meta = item.getItemMeta();
        List<String> lore = meta.hasLore() ? new ArrayList<>(meta.getLore()) : new ArrayList<>();
        Integer previous = meta.getPersistentDataContainer().get(loreKey, PersistentDataType.INTEGER);
        int count = previous == null ? 0 : Math.min(previous, lore.size());
        for (int i = 0; i < count; i++) lore.remove(lore.size() - 1);
        List<String> encoded = new ArrayList<>();
        int added = 0;
        for (Map.Entry<String, Integer> entry : enchants.entrySet()) {
            encoded.add(entry.getKey() + ":" + entry.getValue());
            Definition def = definitions.get(entry.getKey());
            if (def != null) { lore.add(color(def.name() + " &7" + entry.getValue())); added++; }
        }
        meta.setLore(lore);
        if (encoded.isEmpty()) meta.getPersistentDataContainer().remove(enchantKey);
        else meta.getPersistentDataContainer().set(enchantKey, PersistentDataType.STRING, String.join(";", encoded));
        meta.getPersistentDataContainer().set(loreKey, PersistentDataType.INTEGER, added);
        item.setItemMeta(meta);
    }

    private String apply(ItemStack item, Definition def, int level) {
        if (item == null || item.getType().isAir() || item.getAmount() != 1 || !item.hasItemMeta()) return "Hold one enchantable item.";
        if (item.getItemMeta().getPersistentDataContainer().has(bookKey, PersistentDataType.STRING)) return "Books cannot be enchanted.";
        String material = item.getType().name();
        if (getConfig().getStringList("blacklisted-items").stream().anyMatch(material::equalsIgnoreCase)) return "This item is blacklisted.";
        if (!def.items().isEmpty() && def.items().stream().noneMatch(s -> material.endsWith(s.toUpperCase(Locale.ROOT)))) return "This enchantment cannot be applied to that item.";
        if (level < 1 || level > def.maxLevel()) return "Invalid enchantment level.";
        Map<String, Integer> existing = read(item);
        if (!existing.containsKey(def.id()) && existing.size() >= Math.max(0, getConfig().getInt("max-enchantments", 5))) return "This item has reached its enchantment limit.";
        for (String id : existing.keySet()) {
            Definition other = definitions.get(id);
            if (def.conflicts().stream().anyMatch(id::equalsIgnoreCase) || (other != null && other.conflicts().stream().anyMatch(def.id()::equalsIgnoreCase))) return "These enchantments conflict.";
        }
        if (existing.getOrDefault(def.id(), 0) >= level) return "The item already has this level or higher.";
        existing.put(def.id(), level);
        write(item, existing);
        return null;
    }

    private ItemStack book(Definition def, int level) {
        ItemStack item = new ItemStack(org.bukkit.Material.matchMaterial("ENCHANTED_BOOK"));
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(color(def.name() + " &7" + level));
        meta.setLore(List.of(color("&7" + def.description()), color("&7Rarity: &f" + def.rarity()), color("&eDrag onto an eligible item.")));
        meta.getPersistentDataContainer().set(bookKey, PersistentDataType.STRING, def.id() + ":" + level);
        item.setItemMeta(meta);
        return item;
    }

    @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
    public void onBookClick(InventoryClickEvent event) {
        if (!(event.getWhoClicked() instanceof Player player) || !player.hasPermission("divine.use") || event.getClick() != ClickType.LEFT) return;
        ItemStack cursor = event.getCursor();
        if (cursor == null || !cursor.hasItemMeta()) return;
        String data = cursor.getItemMeta().getPersistentDataContainer().get(bookKey, PersistentDataType.STRING);
        if (data == null) return;
        event.setCancelled(true);
        if (event.getClickedInventory() != player.getInventory() || event.getCurrentItem() == null) return;
        String[] parts = data.split(":", 2);
        if (parts.length != 2) return;
        Definition def = definitions.get(parts[0]);
        int level;
        try { level = Integer.parseInt(parts[1]); } catch (NumberFormatException ex) { return; }
        if (def == null) { player.sendMessage(color("&cThis enchantment is unavailable.")); return; }
        ItemStack target = event.getCurrentItem().clone();
        String error = apply(target, def, level);
        if (error != null) { player.sendMessage(color("&c" + error)); return; }
        double success = Math.max(0, Math.min(100, getConfig().getDouble("book-success-percent", 100)));
        if (ThreadLocalRandom.current().nextDouble(100) < success) {
            event.setCurrentItem(target);
            player.sendMessage(color("&aEnchantment applied."));
        } else {
            double destroy = Math.max(0, Math.min(100, getConfig().getDouble("book-destroy-percent", 0)));
            if (ThreadLocalRandom.current().nextDouble(100) < destroy) event.setCurrentItem(null);
            player.sendMessage(color("&cThe enchantment failed."));
        }
        if (cursor.getAmount() <= 1) event.setCursor(null); else { ItemStack remaining = cursor.clone(); remaining.setAmount(cursor.getAmount() - 1); event.setCursor(remaining); }
    }

    @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
    public void onDamage(EntityDamageByEntityEvent event) {
        if (!(event.getEntity() instanceof LivingEntity target)) return;
        if (event.getDamager() instanceof Player attacker && allowed(attacker)) run(attacker, target, attacker.getInventory().getItemInMainHand(), "ATTACK", event);
        if (target instanceof Player defender && allowed(defender) && event.getDamager() instanceof LivingEntity attacker) {
            for (ItemStack armor : defender.getInventory().getArmorContents()) run(defender, attacker, armor, "DEFEND", event);
        }
    }

    private boolean allowed(Player player) {
        return getConfig().getStringList("blacklisted-worlds").stream().noneMatch(player.getWorld().getName()::equalsIgnoreCase);
    }

    private void run(Player owner, LivingEntity target, ItemStack item, String trigger, EntityDamageByEntityEvent event) {
        for (Map.Entry<String, Integer> entry : read(item).entrySet()) {
            Definition def = definitions.get(entry.getKey());
            if (def == null || !def.trigger().equals(trigger)) continue;
            int level = Math.max(1, Math.min(def.maxLevel(), entry.getValue()));
            long now = System.currentTimeMillis();
            Map<String, Long> times = cooldowns.computeIfAbsent(owner.getUniqueId(), k -> new HashMap<>());
            if (times.getOrDefault(def.id(), 0L) > now || ThreadLocalRandom.current().nextDouble(100) >= def.chance()) continue;
            times.put(def.id(), now + def.cooldown());