zephyr.storm.pk
📎 1 file 3,394 chars
📄
pasted-code-1788961644786.txt
txt 61 lines
▶
Act as an expert Minecraft Java Plugin Developer specializing in Paper API (Minecraft 1.20+ / 1.21+).
Create a complete, optimized, modular Minecraft SMP plugin named "ChromaSMP".

=== CORE GAMEPLAY CONCEPT ===
A stat-and-ability theft SMP inspired by BlissSMP and LifestealSMP.
Players possess "Chroma Elements" represented by physical custom items called "Chroma Orbs".

=== 5 ELEMENTS & ABILITIES ===
1. Blood:
   - Passive: +15% Lifesteal on all melee damage.
   - Active (Right-click sword, 30s CD): "Sanguine Drain" - Deals 3 hearts true damage to target within 5 blocks and heals the user.
2. Void:
   - Passive: Fall damage immunity.
   - Active (Right-click sword, 25s CD): "Shadow Shift" - Teleports 8 blocks forward in looking direction and gains Invisibility for 3 seconds.
3. Lightning:
   - Passive: Permanent Speed I.
   - Active (Right-click sword, 35s CD): "Thunder Strike" - Strikes lightning on targeted enemy within 15 blocks, causing 4 hearts damage and brief blindness.
4. Frost:
   - Passive: Hits apply Slowness II (3s) to targets.
   - Active (Right-click sword, 30s CD): "Glacial Prison" - Surrounds targeted player in temporary ice blocks (turns to water/melts in 4s).
5. Solar:
   - Passive: Permanent Fire Resistance + Daytime Strength I.
   - Active (Right-click sword, 40s CD): "Solar Flare" - Emits a blind blast pushing back all players within 6 blocks and setting them on fire for 5s.

=== CORE MECHANICS ===
1. First Join:
   - Randomly assign player 1 of the 5 elements. Give them their physical Element Orb bound to them.
2. PvP Death & Theft:
   - When Player A kills Player B in PvP:
     - Player B drops their active Element Orb as a physical item.
     - Player B's element is stripped.
     - If Player B has 0 orbs left, they enter the "Colorless State":
       - Colorless State: Weakness I, Slowness I, gray particle aura, display gray prefix [Colorless]. Cannot use any element powers.
3. Fusion System:
   - Command `/chroma altar` or a custom GUI allows fusing 2 different element orbs into a "Hybrid Orb":
     - Frost + Lightning = "Blizzard Storm" (Freezes enemies while striking continuous micro-lightnings).
     - Blood + Void = "Vampire Step" (Teleports directly behind enemy and drains 25% of their current health).
     - (Allow modular config for other fusions).
4. Custom Items & NBT:
   - Use PersistentDataContainer (PDC) for item identification (do NOT rely purely on Lore or Display Names).
   - Assign CustomModelData to each Orb for Resource Pack compatibility:
     - Blood Orb: 10001
     - Void Orb: 10002
     - Lightning Orb: 10003
     - Frost Orb: 10004
     - Solar Orb: 10005
     - Hybrid Orbs: 10010+
     - Revive/Awakening Catalyst: 10099 (Craftable item to restore a Colorless player to a random element).

=== TECHNICAL REQUIREMENTS ===
- Language: Java 17 or Java 21, Paper-API.
- Cooldown Manager: Efficient UUID-based cooldown tracking.
- Data Storage: SQLite or YAML with asynchronous saves.
- Configurable: Fully configurable config.yml for cooldowns, damage values, messages, and CustomModelData IDs.
- Commands:
  - /chroma give  
  - /chroma set  
  - /chroma reset 
  - /chroma fuse
  - /chroma info
- Provide the plugin.yml, main class, event listeners, and config.yml in clean, production-ready code.
Kodari AI
KodariSep 9 at 1:52 pm 3
ChromaSMP
A stat-and-ability theft SMP plugin where players possess Chroma Elements represented by physical custom items. Randomly assigns one of five elements (Blood, Void, Lightning, Frost, Solar) on first join, each with unique passives and active abilities. PvP deaths drop the victim's Element Orb, stripping their element and triggering a Colorless State if they have no orbs left. Includes a fusion system to combine two different orbs into Hybrid Orbs, a UUID-based cooldown manager, SQLite/YAML data storage with async saves, and fully configurable config.yml for cooldowns, damage values, messages, and CustomModelData IDs. Commands include /chroma give, set, reset, fuse, and info.
  1. Create the Gradle/Paper project metadata and plugin configuration.

  2. Add persistent player data, element/orb models, cooldowns, and fusion definitions.

  3. Implement gameplay listeners for abilities, passives, item theft, pickup, death, and catalyst use.

  4. Add the /chroma command suite and register all services, listeners, and crafting recipes.

Created the complete ChromaSMP project with:

  • Paper 1.21.4 / Java 17 Gradle setup

  • Five configurable elements and active abilities

  • Persistent asynchronous YAML player storage

  • PDC-based orb, hybrid, and catalyst items

  • PvP element theft and Colorless state

  • Fusion system for Blizzard Storm and Vampire Step

  • /chroma give, /chroma set, /chroma reset, /chroma fuse, /chroma altar, and /chroma info

  • Passive effects, cooldown tracking, catalyst crafting, and configurable messages/model data

  • Modular listeners, managers, command handling, and configuration files

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
20 1,297
src/main/java/com/chromasmp/ChromaSMP.java
package com.chromasmp;

import com.chromasmp.ability.AbilityManager;
import com.chromasmp.command.ChromaCommand;
import com.chromasmp.data.PlayerDataStore;
import com.chromasmp.data.PlayerManager;
import com.chromasmp.element.FusionManager;
import com.chromasmp.item.OrbItemFactory;
import com.chromasmp.listener.AbilityListener;
import com.chromasmp.listener.CombatListener;
import com.chromasmp.listener.OrbListener;
import com.chromasmp.listener.PlayerConnectionListener;
import com.chromasmp.passive.PassiveManager;
import com.chromasmp.util.CooldownManager;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.plugin.java.JavaPlugin;

public final class ChromaSMP extends JavaPlugin {
    private PlayerDataStore dataStore;
    private PlayerManager playerManager;
    private CooldownManager cooldownManager;
    private OrbItemFactory orbItemFactory;
    private FusionManager fusionManager;
    private AbilityManager abilityManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        dataStore = new PlayerDataStore(this);
        playerManager = new PlayerManager(this, dataStore);
        cooldownManager = new CooldownManager();
        orbItemFactory = new OrbItemFactory(this);
        fusionManager = new FusionManager(this, playerManager, orbItemFactory);
        abilityManager = new AbilityManager(this, playerManager, cooldownManager, orbItemFactory, fusionManager);

        Bukkit.getPluginManager().registerEvents(new PlayerConnectionListener(playerManager), this);
        Bukkit.getPluginManager().registerEvents(new OrbListener(playerManager, orbItemFactory), this);
        Bukkit.getPluginManager().registerEvents(new CombatListener(this, playerManager, orbItemFactory), this);
        Bukkit.getPluginManager().registerEvents(new AbilityListener(abilityManager), this);
        new PassiveManager(this, playerManager).start();

        ChromaCommand command = new ChromaCommand(this, playerManager, orbItemFactory, fusionManager);
        getCommand("chroma").setExecutor(command);
        getCommand("chroma").setTabCompleter(command);
        registerCatalystRecipe();
    }

    private void registerCatalystRecipe() {
        ItemStack result = orbItemFactory.createCatalyst();
        ShapedRecipe recipe = new ShapedRecipe(new NamespacedKey(this, "awakening_catalyst"), result);
        recipe.shape(getConfig().getStringList("items.catalyst-recipe.shape").toArray(new String[0]));
        Material netherStar = Material.matchMaterial(getConfig().getString("items.catalyst-recipe.nether-star", "NETHER_STAR"));
        Material ancientDebris = Material.matchMaterial(getConfig().getString("items.catalyst-recipe.ancient-debris", "ANCIENT_DEBRIS"));
        Material amethyst = Material.matchMaterial(getConfig().getString("items.catalyst-recipe.amethyst", "AMETHYST_SHARD"));
        if (netherStar != null && ancientDebris != null && amethyst != null) {
            recipe.setIngredient('N', netherStar);
            recipe.setIngredient('A', ancientDebris);
            recipe.setIngredient('C', amethyst);
            Bukkit.addRecipe(recipe);
        }
    }

    @Override
    public void onDisable() {
        if (playerManager != null) {
            playerManager.saveAllAsync();
        }
    }

    public PlayerManager getPlayerManager() {
        return playerManager;
    }

    public OrbItemFactory getOrbItemFactory() {
        return orbItemFactory;
    }
}