Maximilian

Create a Minecraft Paper 1.21.8 plugin called EnchainedSMP in Java (Maven).

The core mechanic is that every enchantment can be applied to every item. Swords can have Efficiency, boots can have Sharpness, sticks can have Looting, etc.

Features:

Remove vanilla enchantment restrictions completely.

Enchanting Table, Anvil, Enchanted Books, and /enchant all allow any enchantment on any item.

Multiple incompatible enchantments can coexist (e.g. Silk Touch + Fortune).

Configurable max enchant levels in config.yml.

Keep all custom enchantments after repairing, upgrading, or combining items.

Permissions: enchained.use and enchained.admin.

Commands: /enchained reload and /enchained givebook <enchantment> <level>.

Full support for multiplayer with optimized event handling and no duplication bugs.

Generate the complete project: pom.xml, plugin.yml, config.yml, and well-structured source code that compiles without errors.

Kodari AI
KodariSep 27 at 8:52 pm 1
EnchainedSMP
Removes all vanilla enchantment restrictions, allowing any enchantment on any item. Supports enchanting tables, anvils, books, and /enchant with configurable max levels. Incompatible enchantments coexist, custom enchantments persist through repairs and upgrades. Includes /enchained reload and /enchained givebook commands with enchained.use and enchained.admin permissions. Optimized for multiplayer with duplication-safe event handling.
  1. Create the Maven/Paper 1.21.8 project and plugin configuration.

  2. Add shared enchantment lookup, level limits, and unsafe item/book application.

  3. Implement unrestricted enchanting-table/anvil handling plus /enchant and admin commands.

Created the EnchainedSMP Paper 1.21.8 Maven project with:

  • Unrestricted enchantment application for enchanting-table offers, anvil combinations, enchanted books, and /enchant.

  • Configurable level caps in config.yml.

  • /enchained reload and /enchained givebook <enchantment> <level> [player].

  • enchained.use and enchained.admin permissions.

Build with Java 21 and mvn package.

Maximilian
📎 1 file 1,680 chars
📄
pasted-code-1790543017970.txt
txt 81 lines
▶
Create a Paper 1.21.x Minecraft plugin called EnchainSMP.

The main feature is that any enchantment can be applied to any item, while keeping vanilla max levels.

Core Features

Every 15 minutes, every online player receives 1 random enchantment book.

The enchantment is different for every player.

Each enchantment can only be given once to a player until they have collected them all.

After collecting every enchantment, the pool resets automatically.

The book should display the enchantment name and its vanilla level.

Enchanting System

Players can combine the random enchantment book with any item in an anvil.

Ignore vanilla item restrictions (Sharpness on sticks, Protection on helmets, etc.).

Never exceed vanilla limits:

Sharpness V

Protection IV

Unbreaking III

Mending I

etc.

Do not create illegal levels like Sharpness X or Fortune X.

Spear Compatibility

Riptide must fully work on custom spear items.

The spear should behave like a trident for Riptide while still being a spear.

Loyalty, Channeling, and Impaling should also function correctly on spears.

Universal Item Support

Any enchantment should work on any item:

Weapons

Tools

Armor

Blocks

Food

Custom items

Preserve all enchantment effects whenever possible.

Commands

/enchain reload — reload config

/enchain give   — give a specific enchant book

/enchain reset  — reset collected enchantments

Config

Change reward interval (default 900 seconds)

Enable/disable broadcast messages

Customize messages

Support permissions

The code should be clean, optimized, and ready to compile as a Paper plugin with no enchantment level exceeding vanilla limits.
Kodari AI
KodariSep 27 at 9:06 pm 2
  1. Inspect the existing plugin structure and current enchantment handling.

  2. Update the project to the requested EnchainSMP reward-book, anvil, command, and configuration behavior.

  3. Add best-effort spear compatibility while preserving vanilla enchantment level caps.

Updated the Maven project to EnchainSMP with /enchain reload, /enchain give <player> <enchantment>, and /enchain reset <player>. The earlier /enchained command and givebook syntax remain available as aliases.

Online players now receive a random enchanted book on the configured interval. Per-player collections are saved across restarts, avoid repeats until all registered enchantments are collected, then reset. Books show the enchantment name and level; anvil combining and /enchant accept incompatible enchantments while capping levels at vanilla maximums. Reward broadcasts and messages are configurable.

Spear caveat: Paper 1.21.8 has no generic spear item/API. A custom spear based on a trident can use vanilla Riptide, Loyalty, Channeling, and Impaling; Bukkit alone can’t make those native trident behaviors work on an arbitrary custom item.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
8 694
src/main/java/com/kodari/enchainedsmp/EnchainedSMP.java
package com.kodari.enchainedsmp;

import org.bukkit.ChatColor;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.plugin.java.JavaPlugin;

public final class EnchainedSMP extends JavaPlugin {
    private EnchantmentRewardManager rewardManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        rewardManager = new EnchantmentRewardManager(this);
        getServer().getPluginManager().registerEvents(new EnchainedListener(this), this);
        EnchainedCommand command = new EnchainedCommand(this);
        getCommand("enchain").setExecutor(command);
        getCommand("enchain").setTabCompleter(command);
    }

    public int getMaxEnchantmentLevel(Enchantment enchantment) {
        return Math.max(1, enchantment.getMaxLevel());
    }

    public EnchantmentRewardManager getRewardManager() {
        return rewardManager;
    }

    public void reloadPluginConfig() {
        reloadConfig();
        rewardManager.reschedule();
    }

    public String formatMessage(String key, String... replacements) {
        String message = getConfig().getString("messages." + key, "&cMissing message: " + key);
        for (int index = 0; index + 1 < replacements.length; index += 2) {
            message = message.replace(replacements[index], replacements[index + 1]);
        }
        return ChatColor.translateAlternateColorCodes('&', message);
    }
}