Implement the user's requested Enchain SMP Paper 26.3+ plugin in this new empty project. Build a complete, cleanly organized plugin with EnchainSMP.java, MaceListener.java, TridentListener.java, RangedListener.java, AnvilListener.java, command handling, managers/tasks, plugin.yml and config if useful. Requirements: unrestricted enchantments on items through anvil/smithing/commands while enforcing each enchantment's normal vanilla maximum level; avoid Paper APIs that cannot compile on the project's configured target. Add a 15-minute global random max-level enchanted-book distribution with per-player fair cycling so no duplicate enchantments are issued to a player until pool cycled; /enchain givebook <player> [enchantment] [level], reload, timer. Implement sensible, performant versions of requested custom mace/trident/ranged/held-item mechanics: mace Fire Aspect burst and flame, knockback, enhanced Looting/Fortune smash drops, Silk Touch spawn-egg chance, Infinity durability, Efficiency attack cadence; trident Multishot 3-projectile cone, Power/Sharpness damage, Punch knockback, Flame/Fire Aspect fire, Silk Touch ranged/block behavior; sword/bow/crossbow Density, Breach, Wind Burst, Loyalty boomerang/missed arrow return, Riptide dash in rain/water, Channeling lightning with cooldown when not thunder, Impaling when wet/raining; bow/crossbow Efficiency burst, held Protection/Feather Falling/Respiration utilities, held Thorns reflection. Implement only where robust using available Paper/Bukkit API, explicitly avoid unsafe asynchronous world/entity operations (all Bukkit world/entity changes on main thread; schedule async only for pure data if needed). Organize packages listeners, commands, managers, tasks. Provide useful defaults/document unavoidable API limitations rather than leaving requested classes empty. The task must implement feature code only, no tests. Do not try to build; I will compile after your work. Ensure plugin.yml command/permissions and config reload/timer functionality. The user asked to begin by outlining structure and generating main classes/event handlers; deliver a working initial implementation, not just an outline.

Kodari AI
KodariOct 26 at 4:24 pm 2
EnchainSMP
EnchainSMP is a Paper 26.3+ plugin that unlocks unrestricted enchantment combinations while enforcing vanilla maximum levels per enchantment. It features a 15-minute global random max-level enchanted book distribution with fair per-player cycling, plus /enchain commands for giving books, reloading config, and managing timers. The plugin implements custom weapon mechanics including mace fire burst and smash effects, trident multishot cone and ranged behaviors, sword and bow special abilities like Density and Wind Burst, and utility enchantments for held items. All world and entity operations run on the main thread with configurable defaults and robust Bukkit API usage.
  1. Set up the Paper plugin build, metadata, and configuration.

  2. Add shared enchantment/book-cycle utilities and scheduled distribution.

  3. Implement command, anvil/smithing, mace, trident, ranged, and held-item mechanics.

  4. Wire listeners and tasks in the main plugin class.

Implemented the EnchainSMP plugin with Paper 26.3 build metadata, configuration, command handling, listeners, and scheduled tasks.

  • /enchain givebook gives the target their next non-duplicate enchantment in a persisted cycle; optional enchantment and level are capped at that enchantment’s vanilla maximum.

  • /enchain enchant applies a capped enchantment to the sender’s held item. /enchain reload reloads settings and reschedules distribution; /enchain timer shows the countdown.

  • Added unrestricted anvil/smithing enchantment merging, plus mace, trident, ranged-weapon, and held-item mechanics.

  • Bukkit world and entity changes run synchronously. No build or tests were run.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
13 1,079
src/main/java/com/enchain/smp/EnchainSMP.java
package com.enchain.smp;

import com.enchain.smp.commands.EnchainCommand;
import com.enchain.smp.listeners.AnvilListener;
import com.enchain.smp.listeners.MaceListener;
import com.enchain.smp.listeners.RangedListener;
import com.enchain.smp.listeners.TridentListener;
import com.enchain.smp.managers.BookDistributionManager;
import com.enchain.smp.tasks.BookDistributionTask;
import com.enchain.smp.tasks.HeldItemTask;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class EnchainSMP extends JavaPlugin {
    private BookDistributionManager bookDistributionManager;
    private BookDistributionTask bookDistributionTask;
    private long nextDistributionAt;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        bookDistributionManager = new BookDistributionManager(this);

        Bukkit.getPluginManager().registerEvents(new AnvilListener(), this);
        Bukkit.getPluginManager().registerEvents(new MaceListener(this), this);
        Bukkit.getPluginManager().registerEvents(new TridentListener(this), this);
        Bukkit.getPluginManager().registerEvents(new RangedListener(this), this);

        EnchainCommand command = new EnchainCommand(this);
        getCommand("enchain").setExecutor(command);
        getCommand("enchain").setTabCompleter(command);

        new HeldItemTask().runTaskTimer(this, 20L, 20L);
        scheduleDistributionTask();
        getLogger().info("Enchain SMP enabled.");
    }

    @Override
    public void onDisable() {
        if (bookDistributionTask != null) {
            bookDistributionTask.cancel();
        }
    }

    public BookDistributionManager getBookDistributionManager() {
        return bookDistributionManager;
    }

    public void reloadPluginConfiguration() {
        reloadConfig();
        scheduleDistributionTask();
    }

    public long getSecondsUntilDistribution() {
        return Math.max(0, (nextDistributionAt - System.currentTimeMillis() + 999) / 1000);
    }

    public void resetDistributionDeadline() {
        long intervalMillis = Math.max(1, getConfig().getLong("distribution-interval-minutes", 15)) * 60_000L;
        nextDistributionAt = System.currentTimeMillis() + intervalMillis;
    }

    private void scheduleDistributionTask() {
        if (bookDistributionTask != null) {
            bookDistributionTask.cancel();
        }
        long intervalTicks = Math.max(1, getConfig().getLong("distribution-interval-minutes", 15)) * 60L * 20L;
        bookDistributionTask = new BookDistributionTask(this);
        bookDistributionTask.runTaskTimer(this, intervalTicks, intervalTicks);
        resetDistributionDeadline();
    }
}