sigmasayam_17715

Create a plugin about coustome power and enchantment acquire when u enchat item in enchanting table or craft books to do it

Kodari AI
KodariMar 17 at 7:06 am 15,125 (v2)

I’ll create a custom enchantments and powers plugin that adds unique abilities to items through enchanting tables and crafting.

CustomEnchantPowers
A comprehensive custom enchantment and power system that extends Minecraft's enchanting mechanics. Players can acquire unique enchantments through the enchanting table or by crafting special books. Custom enchantments grant powerful abilities like lifesteal, explosive hits, speed boosts, and elemental damage. Fully configurable with support for chance-based effects, cooldowns, and stacking mechanics. Includes admin commands for managing enchantments and granting powers to players.

Perfect! I’ve created a comprehensive custom enchantments and powers plugin with the following features:

Core Features:

  • Custom enchantments that can be acquired through enchanting tables (30% chance by default)

  • Crafting recipes for enchanted books using diamonds, books, and ender eyes

  • Multiple power types: ON_HIT (triggers when hitting enemies), ON_HOLD (triggers when holding item), ON_DAMAGE (triggers when taking damage)

  • Full configuration system with separate files for enchantments and powers

6 Pre-configured Enchantments:

  1. Lifesteal - Heal from damage dealt

  2. Explosive - Create explosions on hit

  3. Lightning - Strike enemies with lightning

  4. Speed Boost - Gain speed when holding item

  5. Vampiric - Drain life and deal bonus damage

  6. Fire Aspect+ - Enhanced fire damage

Command System:

  • /customenchant list - View all enchantments

  • /customenchant give <enchantment> [level] - Apply enchantment to held item

  • /customenchant reload - Reload configurations

Technical Features:

  • XSeries integration for cross-version compatibility (1.8-1.21+)

  • Cooldown system for powers

  • Chance-based effects with level scaling

  • Particle and sound effects

  • Weight-based random selection for enchanting table

  • Lore-based enchantment tracking

The plugin is fully functional and ready to use!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
15 1,237
src/main/java/com/enchantpowers/CustomEnchantPowers.java
package com.enchantpowers;

import com.enchantpowers.commands.EnchantCommand;
import com.enchantpowers.listeners.EnchantTableListener;
import com.enchantpowers.listeners.ItemListener;
import com.enchantpowers.managers.ConfigManager;
import com.enchantpowers.managers.CraftingManager;
import com.enchantpowers.managers.EnchantmentManager;
import com.enchantpowers.managers.PowerManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CustomEnchantPowers extends JavaPlugin {
    
    private ConfigManager configManager;
    private EnchantmentManager enchantmentManager;
    private PowerManager powerManager;
    private CraftingManager craftingManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        configManager.loadConfigs();
        
        this.enchantmentManager = new EnchantmentManager(this);
        enchantmentManager.loadEnchantments();
        
        this.powerManager = new PowerManager(this);
        powerManager.loadPowers();
        
        this.craftingManager = new CraftingManager(this);
        if (configManager.getMainConfig().getBoolean("crafting.enabled", true)) {
            craftingManager.registerRecipes();
        }
        
        getServer().getPluginManager().registerEvents(new EnchantTableListener(this), this);
        getServer().getPluginManager().registerEvents(new ItemListener(this), this);
        
        getCommand("customenchant").setExecutor(new EnchantCommand(this));
        
        getLogger().info("CustomEnchantPowers has been enabled!");
        getLogger().info("Loaded " + enchantmentManager.getAllEnchantments().size() + " custom enchantments");
        getLogger().info("Loaded " + powerManager.getAllPowers().size() + " custom powers");
    }
    
    @Override
    public void onDisable() {
        if (craftingManager != null) {
            craftingManager.unregisterRecipes();
        }
        getLogger().info("CustomEnchantPowers has been disabled!");
    }
}