imlucifer2
📎 1 file 3,274 chars
📄
pasted-code-1782894757691.txt
txt 195 lines
▶
Create a complete Minecraft **Paper 1.21.11** plugin using **Java 21** and **Maven**.

### Plugin Name

CrownCore

### Main Goal

Create a legendary Crown system where **only one Crown can ever be crafted on the entire server**.

---

## Crown Recipe

The Crown must be a custom **Golden Helmet**.

Crafting Recipe:

G D G

F H F

D T T

Where:

* G = Gold Block
* D = Diamond Block
* F = Fire Charge
* T = Ghast Tear
* H = Heavy Core

The recipe must be registered using the Paper API.

---

## One-Time Server Craft

The Crown can only be crafted **once across the entire server**.

Once any player successfully crafts it:

* Permanently disable the recipe for every player.
* Save this status in a data file so it remains disabled after server restarts.
* If anyone tries to craft it again, the crafting result should be empty and they should receive the message:

"You cannot craft another Crown. The legendary Crown has already been forged."

---

## Crown Item

The crafted Crown should be:

* Golden Helmet
* Custom Name: "Crown of Kings"
* Unbreakable
* Hide all item flags
* Identified using PersistentDataContainer (do NOT identify by display name)
* Support CustomModelData for future resource packs

---

## Rewards

Immediately after the player crafts the Crown, automatically give them:

### King's Blade

* Netherite Sword
* Sharpness VI
* Unbreaking X
* Mending
* Unbreakable
* Custom Name: "King's Blade"

### King's Mace

* Mace
* Density V
* Unbreaking X
* Mending
* Unbreakable
* Custom Name: "King's Mace"

These rewards are given automatically without commands.

---

## Crown Effects

Whenever a player wears the Crown:

* Strength III
* Speed III

The effects should refresh every second.

If the player removes the Crown, the effects must disappear immediately.

---

## Death Behaviour

If the Crown owner dies:

* The Crown should drop on the ground like a normal item.
* Do NOT delete it.
* Do NOT keep it in the inventory.

---

## Fire & Lava Protection

If the Crown item is dropped into:

* Lava
* Fire
* Campfire
* Soul Fire

It must **never burn or be destroyed**.

The item should remain on the ground until another player picks it up.

---

## Broadcast

When the Crown is crafted, broadcast:

====================================

 has forged the Legendary Crown of Kings!

There can never be another.

====================================

---

## Commands

Create the following admin commands:

/givecrown 

/crownreload

Permission:

crown.admin

---

## Files

Generate the complete project including:

* pom.xml
* plugin.yml
* config.yml
* data.yml
* All Java classes
* Maven project structure

---

## Project Structure

Organize the code into:

* commands
* listeners
* items
* managers
* utils

---

## Code Requirements

* Java 21
* Paper 1.21.11 API
* Maven
* Use PersistentDataContainer
* No deprecated API
* Well-commented code
* Proper OOP structure
* Production-quality code
* Compile successfully without errors
* Ready to build with `mvn package`

Return the complete source code for every file in the project.
Kodari AI
KodariJul 1 at 8:37 am 2
CrownCore
A legendary Crown system for Paper servers where only one Crown can ever be crafted server-wide. Features include a custom Golden Helmet Crown with PersistentDataContainer identification, shaped recipe using rare materials, one-time craft enforcement via data persistence, automatic King's Blade and King's Mace rewards, Strength III and Speed III effects while worn, fire/lava immunity for the Crown item, death drop behavior, broadcast on forging, and admin commands for Crown management.

I’ll create the complete CrownCore plugin with 15 files.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
15 887
src/main/java/com/crowncore/CrownCorePlugin.java
package com.crowncore;

import com.crowncore.commands.CrownReloadCommand;
import com.crowncore.commands.GiveCrownCommand;
import com.crowncore.listeners.CraftListener;
import com.crowncore.listeners.CrownDeathListener;
import com.crowncore.listeners.CrownFireListener;
import com.crowncore.managers.ConfigManager;
import com.crowncore.managers.CrownManager;
import org.bukkit.plugin.java.JavaPlugin;

/**
 * CrownCore - A legendary one-time craftable Crown system.
 *
 * Manages the Crown of Kings item, its one-time crafting recipe,
 * player rewards, effects, and persistence across restarts.
 */
public class CrownCorePlugin extends JavaPlugin {

    private ConfigManager configManager;
    private CrownManager crownManager;

    @Override
    public void onEnable() {
        // Initialize managers
        this.configManager = new ConfigManager(this);
        this.crownManager = new CrownManager(this);

        // Register event listeners
        getServer().getPluginManager().registerEvents(new CraftListener(this), this);
        getServer().getPluginManager().registerEvents(new CrownFireListener(this), this);
        getServer().getPluginManager().registerEvents(new CrownDeathListener(this), this);

        // Register commands
        getCommand("givecrown").setExecutor(new GiveCrownCommand(this));
        getCommand("crownreload").setExecutor(new CrownReloadCommand(this));

        // Start the crown effects task
        crownManager.startEffectTask();

        getLogger().info("CrownCore has been enabled.");
    }

    @Override
    public void onDisable() {
        crownManager.stopEffectTask();
        getLogger().info("CrownCore has been disabled.");
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public CrownManager getCrownManager() {
        return crownManager;
    }
}