goldencampp
📎 1 file 3,674 chars
📄
pasted-code-1786015070492.txt
txt 150 lines
▶
# Minecraft Plugin Development Prompt

Create a **Minecraft Paper Plugin** for **Minecraft 1.21.x** using **Java 21** and **Maven**.

## Plugin Name

**DemonArmor**

## Main Feature

Create a custom armor set called **Demon Armor**.

### Armor Details

* Base Material: Netherite Armor
* Display Name: **Demon Armor**
* Every armor piece (Helmet, Chestplate, Leggings, Boots) must have:

  * Protection IV
  * Unbreaking III
  * Mending
* The armor should look like a normal Netherite Armor by default, but it must support **CustomModelData** so I can add my own custom texture pack later.
* Each armor piece must have its own configurable **CustomModelData** value inside `config.yml`.

---

## Full Set Ability

When a player wears the complete Demon Armor set:

* Increase the player's maximum health to **20 Hearts (40 HP)**.
* Give the player **Speed II** continuously.
* The effects must apply automatically when the player wears the complete set.
* If even one armor piece is removed, all custom effects must be removed immediately.
* The plugin should constantly check armor changes efficiently without causing lag.

---

## Custom Crafting System

The Demon Armor must have its own custom crafting recipes.

Requirements:

* Every armor piece must have its own crafting recipe.
* Recipes should normally use Netherite Armor together with other materials, but **nothing should be hardcoded**.
* Every recipe must be **100% configurable** through `config.yml`.
* Server owners must be able to:

  * Change recipe ingredients.
  * Change recipe shape.
  * Add or remove ingredients.
  * Replace ingredients with completely different items.
  * Create their own custom recipes.
  * Enable or disable any recipe.
* The plugin should automatically load the recipe from the config.
* Running `/demonarmor reload` should reload every recipe without restarting the server.

---

## CustomModelData Support

The plugin must support **CustomModelData**.

Requirements:

* Helmet, Chestplate, Leggings and Boots should each have separate configurable CustomModelData values.
* CustomModelData values must be loaded from `config.yml`.
* Whenever the plugin gives or crafts the armor, it should automatically assign the correct CustomModelData.

---

## Commands

### Give Armor

```text
/demonarmor give 
```

Gives the player the complete Demon Armor set.

### Reload Plugin

```text
/demonarmor reload
```

Reloads the plugin configuration and all crafting recipes.

---

## Permissions

```text
demonarmor.give
demonarmor.reload
```

---

## Configuration

Everything below should be configurable inside `config.yml`:

* Armor Name
* Lore
* Enchantments
* Maximum Hearts
* Speed Level
* CustomModelData
* Every crafting recipe
* Enable/Disable recipes

Nothing should be hardcoded except default values.

---

## Code Requirements

* Paper 1.21.x
* Java 21
* Maven Project
* Clean OOP architecture
* Proper package structure
* Well-commented code
* Optimized event handling
* No deprecated APIs
* No console errors
* Production-ready code
* Multiplayer optimized
* Easy to expand with future abilities

---

## Deliverables

Generate the complete project including:

* Complete Java source code
* `plugin.yml`
* `config.yml`
* `pom.xml`
* Complete folder structure
* README with installation instructions
* Build instructions
* The project should compile successfully in IntelliJ IDEA without any errors.

The final result should be a professional-quality Minecraft Paper plugin that is ready to use on a real server.
Kodari AI
KodariAug 6 at 11:20 am 11
DemonArmor
A Paper plugin for Minecraft 1.21.x that adds a fully configurable Demon Armor set. Players receive netherite armor pieces with configurable enchantments, CustomModelData, and lore. Wearing the complete set grants 20 hearts and Speed II, automatically removed when any piece is unequipped. Includes a fully configurable crafting system where every recipe shape, ingredient, and enablement is defined in config.yml, reloadable via command. Features give and reload commands with permissions, optimized armor checking, and clean OOP architecture ready for expansion.
  1. Create the Maven Paper 1.21.4 project and plugin metadata.

  2. Implement configurable Demon Armor creation, recipes, abilities, commands, and event handling.

  3. Add default configuration and installation/build documentation.

Created the complete DemonArmor Maven project:

  • Paper 1.21.4 / Java 21 setup with pom.xml

  • Configurable Demon Armor items, CustomModelData, enchantments, lore, and materials

  • Config-driven shaped recipes with per-piece enablement and reload support

  • Full-set 40 HP and Speed II abilities with armor-change event handling

  • /demonarmor give <player> and /demonarmor reload

  • Permissions, default configuration, plugin metadata, and README build/install instructions

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
14 808
src/main/java/com/kodari/demonarmor/DemonArmorPlugin.java
package com.kodari.demonarmor;

import com.kodari.demonarmor.armor.ArmorFactory;
import com.kodari.demonarmor.armor.ArmorManager;
import com.kodari.demonarmor.command.DemonArmorCommand;
import com.kodari.demonarmor.config.ConfigManager;
import com.kodari.demonarmor.listener.DemonArmorListener;
import com.kodari.demonarmor.recipe.RecipeManager;
import lombok.Getter;
import org.bukkit.command.PluginCommand;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Map;
import java.util.Objects;

@Getter
public final class DemonArmorPlugin extends JavaPlugin {

    private ConfigManager configManager;
    private ArmorFactory armorFactory;
    private ArmorManager armorManager;
    private RecipeManager recipeManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        configManager = new ConfigManager(this);
        armorFactory = new ArmorFactory(this, configManager);
        armorManager = new ArmorManager(this, configManager, armorFactory);
        recipeManager = new RecipeManager(this, configManager, armorFactory);

        recipeManager.reloadRecipes();
        getServer().getPluginManager().registerEvents(new DemonArmorListener(this, armorManager), this);

        DemonArmorCommand command = new DemonArmorCommand(this);
        PluginCommand pluginCommand = Objects.requireNonNull(getCommand("demonarmor"), "demonarmor command is missing from plugin.yml");
        pluginCommand.setExecutor(command);
        pluginCommand.setTabCompleter(command);

        getServer().getScheduler().runTaskTimer(this, armorManager::refreshOnlinePlayers, 20L, 20L);
    }

    @Override
    public void onDisable() {
        if (armorManager != null) {
            armorManager.clearAll();
        }
        if (recipeManager != null) {
            recipeManager.unregisterRecipes();
        }
    }

    public void reloadPlugin() {
        configManager.reload();
        recipeManager.reloadRecipes();
        armorManager.refreshOnlinePlayers();
    }

    public void giveArmor(Player player) {
        for (ItemStack armorPiece : armorFactory.createFullSet()) {
            Map<Integer, ItemStack> remaining = player.getInventory().addItem(armorPiece);
            remaining.values().forEach(item -> player.getWorld().dropItemNaturally(player.getLocation(), item));
        }
    }
}