gamestromerz
๐Ÿ“Ž 1 file 3,133 chars
๐Ÿ“„
minecraft_custom_enchants_plugin_instructions.txt
txt 130 lines
โ–ถ
Minecraft Paper Plugin Guide: Custom Enchants

Overview

This document provides instructions for an AI or developer to create a
Minecraft Paper plugin that adds Custom Enchantments to the latest
Minecraft version supported by Paper.

Plugin Name Suggestion: CustomEnchants

Target Platform: - Minecraft Server: Paper (latest version) - Language:
Java - Build Tool: Maven or Gradle - Java Version: 17 or newer

Core Features

1.  Add new custom enchantments not present in vanilla Minecraft.
2.  Enchantments work on weapons, armor, and tools.
3.  Enchantments can trigger special abilities when conditions are met.
4.  Configurable enchantments using config.yml.
5.  Support for commands and permissions.
6.  Visual effects, sounds, and cooldowns.

Suggested Custom Enchants

1. Lightning Strike

Effect: Chance to strike lightning when hitting a mob or player.

Details: - Works on swords - 10โ€“20% activation chance - Spawns lightning
effect - Configurable damage bonus

2. Lifesteal

Effect: Player heals a portion of damage dealt.

Details: - Works on swords and axes - Heal 5โ€“10% of damage dealt -
Optional cooldown

3. Frost Walker Combat

Effect: Slows enemies when hit.

Details: - Applies Slowness effect - Duration configurable - Particle
effects optional

4. Auto Smelt

Effect: Blocks drop smelted versions when mined.

Example: Iron Ore โ†’ Iron Ingot

Works with: - Pickaxes - Ores and sand

5. Explosive Arrows

Effect: Arrows explode on impact.

Details: - Small explosion radius - No block damage option -
Configurable power

Plugin Structure

Example Package Layout:

com.yourplugin.customenchants Main.java enchantments/
LightningEnchant.java LifestealEnchant.java FrostEnchant.java
AutoSmeltEnchant.java ExplosiveArrowsEnchant.java listeners/
DamageListener.java MiningListener.java ProjectileListener.java
commands/ EnchantCommand.java utils/ EnchantManager.java
ConfigManager.java

Main Plugin Class

Responsibilities: - Register events - Load config - Register commands -
Initialize enchant manager

Events To Use

EntityDamageByEntityEvent BlockBreakEvent ProjectileHitEvent
PlayerInteractEvent

Example Logic Flow

1.  Player attacks entity.
2.  Check if weapon has custom enchant.
3.  Calculate activation chance.
4.  Trigger effect if successful.
5.  Play sound/particles.

Commands

/enchant give /enchant list /enchant reload

Permissions: customenchants.admin customenchants.use

Config Example

config.yml

enchantments: lifesteal: enabled: true heal-percent: 0.08 lightning:
chance: 0.15 explosive_arrows: power: 2

Optional Advanced Features

-   INVENTORY GUI enchantment menu
-   Enchant books
-   Custom rarity system
-   Economy cost for enchantments
-   Enchant conflicts
-   Enchant levels (Iโ€“V)

Testing Steps

1.  Install Paper server.
2.  Compile plugin jar.
3.  Place jar in plugins folder.
4.  Restart server.
5.  Test enchant commands and effects.

Performance Considerations

-   Avoid heavy calculations in events.
-   Cache enchant checks.
-   Use async tasks where safe.

Goal

Create a stable and expandable custom enchantment system that server
owners can easily configure and extend.
Kodari AI
KodariMar 8 at 5:11 pm 24,578 (v2)

Iโ€™ll create a comprehensive custom enchantment plugin with GUI support, configurable enchantments, and visual effects.

CustomEnchants
A feature-rich custom enchantment system adding Lightning Strike, Lifesteal, Frost Walker Combat, Auto Smelt, and Explosive Arrows enchantments. Features include configurable activation chances, visual effects, particles, sounds, cooldown management, enchantment levels (I-V), and an interactive GUI menu for applying enchantments. Fully compatible with Paper servers using XSeries for cross-version support.

All files created! The custom enchantments plugin is complete with:

Core Features:

  • 5 custom enchantments (Lightning Strike, Lifesteal, Frost Walker Combat, Auto Smelt, Explosive Arrows)

  • GUI-based enchantment application menu

  • Persistent enchantment storage using PersistentDataContainer

  • Enchantment levels (I-V) with Roman numeral display

  • Cooldown system for enchantments

  • Visual effects (particles & sounds)

  • Fully configurable via config.yml

Commands:

  • /enchant - Opens GUI menu

  • /enchant give <enchant> <level> - Apply enchant to held item

  • /enchant list - List all enchantments

  • /enchant reload - Reload configuration

Technical Highlights:

  • Uses XSeries for cross-version compatibility

  • Lombok annotations for cleaner code

  • Event-driven GUI framework with lazy initialization

  • Proper enchantment validation for applicable items

  • PDC-based enchantment storage (survives server restarts)

The plugin is ready to compile and deploy on any Paper server!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
23 1,341
src/main/java/com/yourplugin/customenchants/CustomEnchants.java
package com.yourplugin.customenchants;

import com.yourplugin.customenchants.command.EnchantCommand;
import com.yourplugin.customenchants.inventory.gui.GUIListener;
import com.yourplugin.customenchants.inventory.gui.GUIManager;
import com.yourplugin.customenchants.listener.DamageListener;
import com.yourplugin.customenchants.listener.MiningListener;
import com.yourplugin.customenchants.listener.ProjectileListener;
import com.yourplugin.customenchants.manager.ConfigManager;
import com.yourplugin.customenchants.manager.EnchantManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class CustomEnchants extends JavaPlugin {
    
    private ConfigManager configManager;
    private EnchantManager enchantManager;
    private GUIManager guiManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.enchantManager = new EnchantManager(this);
        this.guiManager = new GUIManager();
        
        registerListeners();
        registerCommands();
        
        getLogger().info("CustomEnchants has been enabled!");
    }
    
    @Override
    public void onDisable() {
        getLogger().info("CustomEnchants has been disabled!");
    }
    
    private void registerListeners() {
        getServer().getPluginManager().registerEvents(new DamageListener(this), this);
        getServer().getPluginManager().registerEvents(new MiningListener(this), this);
        getServer().getPluginManager().registerEvents(new ProjectileListener(this), this);
        getServer().getPluginManager().registerEvents(new GUIListener(guiManager), this);
    }
    
    private void registerCommands() {
        getCommand("enchant").setExecutor(new EnchantCommand(this));
    }
    
    public void reload() {
        reloadConfig();
        configManager = new ConfigManager(this);
        enchantManager = new EnchantManager(this);
    }
}