justhervecna.
๐Ÿ“Ž 1 file 8,185 chars
๐Ÿ“„
pasted-code-1791285026037.txt
txt 597 lines
โ–ถ
Build a complete, production-ready Minecraft **Crownfall SMP plugin** from scratch.

### PLATFORM

* Minecraft: **Paper 1.21.11**
* Java: **Java 21**
* Build: **Maven**
* Language: **Java**
* Plugin name: `Crownfall`
* JAR: `Crownfall.jar`
* Main class: `com.crownfall.Crownfall`
* Base package: `com.crownfall`

The plugin must compile successfully with:

```bash
mvn clean package
```

Output:

```text
target/Crownfall.jar
```

---

## ๐Ÿ‘‘ COMPLETE CROWNFALL BRANDING

The entire plugin must be branded **Crownfall**.

Use `Crownfall` / `Crownfall SMP` everywhere:

* Plugin name
* JAR name
* Java packages
* Main class
* Commands
* Permissions
* Configurations
* Messages
* GUI
* Scoreboard
* BossBars
* Item names
* Item lore
* Console messages
* README
* Database identifiers
* Documentation

Do NOT use any old or placeholder branding such as:

`KingsSMP`, `Kings SMP`, `TokenSMP`, `TokenGlorySMP`, `Xyron SMP`, `ExamplePlugin`, `MyPlugin`, `TestPlugin`.

Kings can still exist as a **gameplay concept**, but the product/plugin brand must always be **Crownfall**.

---

# ๐Ÿ‘‘ FEATURES

## 1. King System

* Multiple Kings
* Configurable maximum Kings
* Assign/remove Kings
* Persistent King data
* King progression
* King statistics
* King protection

Commands:

```text
/crownfall king 
/crownfall remove 
/crownfall kings
```

---

## 2. ๐Ÿ‘‘ Crown System

Create a unique:

**Crownfall Crown**

Features:

* Custom name/lore
* Custom material
* Custom model data support
* PersistentDataContainer ID
* Enchantments
* Passive abilities
* Particles
* Sounds
* Cooldowns
* Crown ownership
* Configurable effects

Command:

```text
/crownfall crown 
```

---

## 3. โš”๏ธ Crownfall Sword

Create a unique:

**Crownfall Sword**

Features:

* Custom damage
* Custom attributes
* Enchantments
* Special ability
* Particles
* Sounds
* Cooldown
* PersistentDataContainer

Command:

```text
/crownfall sword 
```

---

## 4. ๐Ÿ”จ Crownfall Mace

Create:

**Crownfall Mace**

Features:

* Custom damage
* Custom attributes
* Special ability
* Shockwave
* Particles
* Sounds
* Cooldown
* PersistentDataContainer

Command:

```text
/crownfall mace 
```

---

## 5. โค๏ธ Heart System

Create a persistent heart/life system.

Features:

* Gain hearts
* Lose hearts
* Kill rewards
* Death penalties
* Minimum hearts
* Maximum hearts
* Elimination
* Persistent storage
* Anti-duplication

Commands:

```text
/crownfall hearts  set 
/crownfall hearts  add 
/crownfall hearts  remove 
```

---

## 6. ๐Ÿฉธ Kill System

Track:

* Kills
* Deaths
* Kill streak
* Progression
* Heart rewards

Prevent kill farming and repeated-player exploits.

---

## 7. โœจ Crown Abilities

Add several abilities:

* Royal Strength
* Royal Speed
* Crown Shield
* Royal Regeneration
* Crown Shockwave
* Royal Teleport

Each ability needs:

* Cooldown
* Duration
* Permission
* Particles
* Sounds
* Configurable effects
* Enable/disable setting

Command:

```text
/crownfall ability
```

---

## 8. ๐Ÿค Trust System

Commands:

```text
/crownfall trust 
/crownfall untrust 
/crownfall trustlist
```

Features:

* UUID-based storage
* Persistent trust list
* Trusted players can bypass configurable abilities
* Trust GUI

---

## 9. ๐ŸŒ€ Crownfall Ritual

Create a configurable ritual system.

Features:

* Required items
* Ritual location
* Ritual radius
* Countdown
* BossBar
* Multiple stages
* Particles
* Sounds
* Rewards
* Cancellation
* Cooldown
* Anti-duplication

Command:

```text
/crownfall ritual
```

BossBar:

```text
๐Ÿ‘‘ Crownfall Ritual
```

---

## 10. โš”๏ธ Combat Tag

Features:

* Configurable combat duration
* ActionBar/BossBar
* Command blocking
* Countdown
* Safe logout handling

Example:

```text
โš” You are in combat! 15s
```

---

## 11. ๐Ÿšซ Combat Logout

If a player logs out during combat:

Configurable:

* Kill player
* Drop inventory
* Remove hearts
* Give killer reward
* Broadcast message

Do not punish players during server shutdown/restart.

---

## 12. ๐Ÿ“ฆ GUI

Create a polished Crownfall GUI.

Display:

* King status
* Crown status
* Hearts
* Kills
* Deaths
* Kill streak
* Abilities
* Cooldowns
* Trust
* Ritual status
* Statistics

Everything should be configurable.

---

## 13. ๐Ÿ“Š Scoreboard

Create:

```text
      ๐Ÿ‘‘ CROWNFALL

King: Yes
โค๏ธ Hearts: 20
โš” Kills: 12
โ˜  Deaths: 3

Crown: Equipped

     crownfall
```

Make the scoreboard fully configurable.

---

## 14. ๐Ÿ’พ Database

Use **SQLite**.

Store:

* UUID
* King status
* Hearts
* Kills
* Deaths
* Kill streak
* Crown ownership
* Trust list
* Progression
* Ability data
* Statistics

Use asynchronous database operations.

Never block the Minecraft main thread.

---

## 15. โš™๏ธ config.yml

Create a complete configuration:

```yaml
branding:
kings:
crowns:
weapons:
hearts:
abilities:
rituals:
combat:
combat-logout:
trust:
gui:
scoreboard:
sounds:
particles:
database:
```

All important gameplay values must be configurable.

---

## 16. ๐Ÿ’ฌ messages.yml

Put every user-facing message into `messages.yml`.

Include:

* Prefix
* Commands
* Errors
* Permissions
* Cooldowns
* Crown messages
* King messages
* Ability messages
* Ritual messages
* Combat messages
* Heart messages
* Admin messages

Use:

```text
&8[&6Crownfall&8] &f
```

as the default prefix.

---

## 17. ๐Ÿงฐ Commands

Main command:

```text
/crownfall
```

Implement:

```text
/crownfall help
/crownfall info
/crownfall crown 
/crownfall sword 
/crownfall mace 
/crownfall ability
/crownfall ritual
/crownfall king 
/crownfall remove 
/crownfall kings
/crownfall trust 
/crownfall untrust 
/crownfall trustlist
/crownfall hearts  set 
/crownfall hearts  add 
/crownfall hearts  remove 
/crownfall stats [player]
/crownfall reload
```

Add full tab completion.

---

## 18. ๐Ÿ” Permissions

Use:

```text
crownfall.admin
crownfall.reload
crownfall.king
crownfall.crown
crownfall.sword
crownfall.mace
crownfall.ability
crownfall.ritual
crownfall.trust
crownfall.hearts
crownfall.stats
```

---

## 19. ๐Ÿ›ก๏ธ Anti-Exploit

Protect against:

* Item duplication
* Crown duplication
* Heart duplication
* Kill farming
* Ability spam
* Ritual duplication
* Combat logout exploits
* Fake custom items
* Invalid commands
* Database corruption
* Reload problems

Use `PersistentDataContainer` for custom items.

---

## 20. CODE QUALITY

Requirements:

* Clean Java architecture
* Separate managers
* Separate listeners
* Separate commands
* Proper exception handling
* Paper API best practices
* No unnecessary NMS
* Async database operations
* No memory leaks
* Proper shutdown cleanup
* UUID-based player data
* Fully configurable
* Paper 1.21.11 compatible

---

# ๐Ÿ“ REQUIRED FILES

Generate the complete project:

```text
Crownfall/
โ”œโ”€โ”€ pom.xml
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ src/
    โ””โ”€โ”€ main/
        โ”œโ”€โ”€ java/
        โ”‚   โ””โ”€โ”€ com/
        โ”‚       โ””โ”€โ”€ crownfall/
        โ”‚           โ”œโ”€โ”€ Crownfall.java
        โ”‚           โ”œโ”€โ”€ commands/
        โ”‚           โ”œโ”€โ”€ abilities/
        โ”‚           โ”œโ”€โ”€ crown/
        โ”‚           โ”œโ”€โ”€ weapons/
        โ”‚           โ”œโ”€โ”€ kings/
        โ”‚           โ”œโ”€โ”€ hearts/
        โ”‚           โ”œโ”€โ”€ rituals/
        โ”‚           โ”œโ”€โ”€ combat/
        โ”‚           โ”œโ”€โ”€ trust/
        โ”‚           โ”œโ”€โ”€ gui/
        โ”‚           โ”œโ”€โ”€ data/
        โ”‚           โ”œโ”€โ”€ listeners/
        โ”‚           โ”œโ”€โ”€ managers/
        โ”‚           โ””โ”€โ”€ utilities/
        โ””โ”€โ”€ resources/
            โ”œโ”€โ”€ plugin.yml
            โ”œโ”€โ”€ config.yml
            โ””โ”€โ”€ messages.yml
```

Generate **real, complete, compilable Java code**.

Do NOT provide pseudo-code.

Do NOT leave TODOs.

Do NOT leave empty methods.

Do NOT omit required classes.

Make sure all imports, packages, commands and configuration paths match.

---

# ๐Ÿท๏ธ FINAL BRANDING RULE

The final plugin must be known as:

# ๐Ÿ‘‘ CROWNFALL

Console:

```text
[Crownfall] Plugin enabled!
[Crownfall] Database connected!
[Crownfall] All systems loaded!
```

The plugin must never identify itself as KingsSMP, TokenSMP, TokenGlorySMP, Xyron SMP, or any other old/placeholder project.

Generate the complete Crownfall SMP plugin now.
Kodari AI
KodariOct 6 at 11:19 am 3
CrownfallSMP
A comprehensive SMP plugin featuring a persistent King system with configurable crowns, custom weapons, and heart-based progression. Includes kill tracking, combat tagging with logout penalties, trust management, and a multi-stage ritual system with BossBar countdown. Features a full GUI dashboard, configurable scoreboard, SQLite async storage, and extensive anti-exploit protections. All systems are fully configurable via config.yml and messages.yml, with complete command and permission support.
  1. Set up the Paper 1.21.11 Maven project and Crownfall resources.

  2. Add asynchronous SQLite profiles, hearts, kings, and trust persistence.

  3. Implement custom items, abilities, combat, ritual, GUI, scoreboard, and commands.

  4. Wire lifecycle/listeners and document the finished plugin.

Created the Crownfall project with a Paper 1.21.11 / Java 21 Maven setup configured to produce target/Crownfall.jar. It includes SQLite-backed player profiles and trust lists, kings and hearts, PDC-marked items, abilities, combat tagging and logout penalties, the ritual, GUIs, scoreboard, commands and tab completion, configuration, messages, and a README.

I did not run mvn clean package in this environment.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
README.md
Code
19 2,225
src/main/java/com/crownfall/Crownfall.java
package com.crownfall;

import com.crownfall.commands.CrownfallCommand;
import com.crownfall.data.DatabaseManager;
import com.crownfall.listeners.PlayerListener;
import com.crownfall.managers.AbilityManager;
import com.crownfall.managers.CombatManager;
import com.crownfall.managers.ItemManager;
import com.crownfall.managers.ProfileManager;
import com.crownfall.managers.RitualManager;
import com.crownfall.managers.ScoreboardManager;
import com.crownfall.managers.TrustManager;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;
import java.util.Objects;

public final class Crownfall extends JavaPlugin {
    private DatabaseManager database;
    private ProfileManager profiles;
    private ScoreboardManager scoreboards;
    private ItemManager items;
    private TrustManager trust;
    private AbilityManager abilities;
    private CombatManager combat;
    private RitualManager rituals;
    private YamlConfiguration messages;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        if (!new File(getDataFolder(), "messages.yml").exists()) {
            saveResource("messages.yml", false);
        }
        loadMessages();
        database = new DatabaseManager(this);
        profiles = new ProfileManager(this, database);
        scoreboards = new ScoreboardManager(this, profiles);
        items = new ItemManager(this);
        trust = new TrustManager(this, database);
        abilities = new AbilityManager(this, trust);
        combat = new CombatManager(this, profiles);
        rituals = new RitualManager(this, profiles, items);
        Bukkit.getPluginManager().registerEvents(new PlayerListener(this, profiles, combat, abilities, trust, rituals), this);
        CrownfallCommand command = new CrownfallCommand(this);
        Objects.requireNonNull(getCommand("crownfall")).setExecutor(command);
        Objects.requireNonNull(getCommand("crownfall")).setTabCompleter(command);
        Bukkit.getScheduler().runTaskTimer(this, scoreboards::refreshAll, 20L, 100L);
        Bukkit.getScheduler().runTaskTimer(this, abilities::passiveTick, 40L, 40L);
        getLogger().info("[Crownfall] Plugin enabled!");
        getLogger().info("[Crownfall] All systems loaded!");
        database.ready().whenComplete((ignored, error) -> {
            if (error == null) {
                getLogger().info("[Crownfall] Database connected!");
            } else {
                getLogger().severe("[Crownfall] Database connection failed: " + error.getMessage());
            }
        });
    }

    @Override
    public void onDisable() {
        if (combat != null) {
            combat.markShuttingDown();
            combat.shutdown();
        }
        if (rituals != null) {
            rituals.shutdown();
        }
        if (profiles != null) {
            profiles.saveAll();
        }
        if (database != null) {
            database.closeAfterPendingWork();
        }
    }

    public void reloadCrownfall() {
        reloadConfig();
        loadMessages();
        if (scoreboards != null) {
            scoreboards.refreshAll();
        }
    }

    private void loadMessages() {
        messages = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "messages.yml"));
    }

    public DatabaseManager database() {
        return database;
    }

    public ProfileManager profiles() {
        return profiles;
    }

    public ScoreboardManager scoreboards() {
        return scoreboards;
    }

    public ItemManager items() {
        return items;
    }

    public TrustManager trust() {
        return trust;
    }

    public AbilityManager abilities() {
        return abilities;
    }

    public CombatManager combat() {
        return combat;
    }

    public RitualManager rituals() {
        return rituals;
    }

    public YamlConfiguration messages() {
        return messages;
    }
}