gamerrajan
📎 1 file 3,931 chars
📄
pasted-code-1777449428260.txt
txt 201 lines
▶
You are a senior Minecraft plugin developer and software architect specializing in Paper/Spigot 1.21.11 using Java 24. Your task is to build a fully functional, production-ready, optimized Minecraft plugin named DomainPower.

The plugin must follow clean modular architecture using:

Main class
Commands
Listeners
Managers
Utils

Use Maven structure and ensure the code is ready to compile in IntelliJ IDEA without missing parts.

🎯 CORE SYSTEM OVERVIEW

Create an anime-style Domain Expansion combat system where players have unique powers and can teleport into special domains to fight using abilities.

System must be:

Multiplayer-safe
Optimized (no lag)
Exploit-proof
Visually immersive
⚡ POWER SYSTEM

Each player has a permanent power:

fire_power
ice_power
shadow_power
teleport_power
healing_power

Must be saved persistently.

🌟 POWER ITEM
Base item: NETHER_STAR
Use CustomModelData (resource pack compatible)
Names must be bold + colored:
Fire Power → Red
Ice Power → Blue
Shadow Power → Dark Purple
Teleport Power → Light Purple
Healing Power → Green
Use PersistentDataContainer:
power type
owner UUID
Item restrictions:
Cannot be dropped
Cannot be moved to containers
Cannot be used by other players
Cannot be duplicated
🎮 COMMAND SYSTEM (UPDATED)
Player Commands:
/activate → gives own power item
/domain power → shows player power
/domain cooldown → shows cooldown
🛡️ ADMIN COMMANDS:
/domain give 
Gives the specified power item to the player
Must validate power name:
fire_power
ice_power
shadow_power
teleport_power
healing_power
Assigns correct:
CustomModelData
Display name
PDC data (power + owner UUID)
Should replace existing power item if already present
/allpower
Gives admin ALL powers
Either:
5 separate items OR
1 combined admin item (developer choice)
/setdomain 
Saves admin location as domain for that power
/visitdomain 
Teleports player to that domain
🌌 DOMAIN SYSTEM
Each power has a config-based domain location
Behavior:
Right-click power item → enter domain
Duration: 60 seconds
After end:
All players return to original location
If only powerholder remains:
End domain early

Must:

Track players inside
Store original locations
Reset domain completely after use
🔥 ABILITY SYSTEM

Each power has:

Right-click ability
Shift + Right-click ability
Domain passive effect
🔥 FIRE POWER
Right-click → fireball
3 hearts damage
25s cooldown (ActionBar)
❄️ ICE POWER
Right-click → snowball (3 hearts damage)
25s cooldown
Domain:
Freeze others 10s (no movement, can rotate + attack)
Shift + Right-click:
3x3 ice area (7s)
One-time use per domain
🌑 SHADOW POWER
Right-click:
Remove all lights (7s)
Invisibility (armor + items hidden)
Domain:
Blindness + darkness (10s)
Shift + Right-click:
Remove all effects except blindness/darkness
One-time use
⚡ TELEPORT POWER
Right-click:
Open INVENTORY GUI → select domain
Teleport all players there
Domain:
Spawn 6 Endermen (attack others)
Despawn after 10s
Shift + Right-click:
Random teleport (10s, no damage)
💚 HEALING POWER
Domain:
Poison others (10s)
Right-click:
Resistance V + saturation + healing (10s)
Shift + Right-click:
Auto harming arrows (6s)
⚙️ SYSTEM REQUIREMENTS
BossBar:
Domain timer
Cooldowns
ActionBar:
Ability cooldown display
Particle + sound effects per ability
Hit tracking:
100 hits unlock power
Safe teleport system
🔒 SAFETY

Handle:

Logout
Death
Restart
Teleport exploits
Inventory exploits
Duplication bugs
⚡ PERFORMANCE
No lag
Efficient scheduler
No heavy loops
Clean memory
🧱 STRUCTURE

Managers:

DomainManager
PowerManager
CooldownManager
BossBarManager
DomainLocationManager
CombatManager
📦 CONFIG

Include:

domain locations
cooldowns
messages
📤 OUTPUT FORMAT

Return:

Folder structure
Main class
All Java classes
plugin.yml
config.yml
INVENTORY GUI code
Setup guide
Explanation
🎯 FINAL GOAL

Create a plugin that is:

Cinematic
Modular
Multiplayer-safe
Optimized
Fully working on Paper 1.21.11
Kodari AI
KodariApr 29 at 8:09 am 60,759 (v2)
DomainPower
An anime-style Domain Expansion combat plugin for Paper 1.21.1. Players earn unique powers (Fire, Ice, Shadow, Teleport, Healing) through combat, then right-click their power item to expand a domain — teleporting all players to an arena for 60 seconds. Each power has active abilities, shift abilities (one-time per domain), and passive domain effects. Features a fully custom GUI, BossBar timer, ActionBar cooldowns, persistent power storage, and full exploit protection.

Here’s the full plan before writing:

  • Utils/Enums first → PowerType, Keys, ItemUtil, MessageUtil

  • Inventory framework → InventoryHandler, InventoryButton, InventoryGUI, GUIManager, GUIListener, DomainSelectGUI

  • Managers → PowerManager, CooldownManager, BossBarManager, DomainLocationManager, CombatManager, DomainSession, DomainManager

  • Listeners → PowerItemListener, PlayerListener, AbilityListener

  • Commands → ActivateCommand, DomainCommand, AllPowerCommand, SetDomainCommand, VisitDomainCommand

  • Main → DomainPower


What was built — complete feature summary:

Core Systems:

  • PowerType enum — 5 powers with IDs, display names (legacy colored), and custom model data (1001–1005)

  • Keys — centralized NamespacedKey store for all PDC keys

  • ItemUtil — creates NETHER_STAR power items with PDC owner/type, supports isPowerItem, getPowerType, getOwnerUUID

  • PowerManager — persists powers to players.yml, handles giveOrReplacePowerItem, assignRandomPower

  • CooldownManager — millisecond-precision cooldown tracking per player per ability key

  • BossBarManager — shows/hides/destroys boss bars for domain sessions

  • DomainLocationManager — saves/loads domain coords from config.yml

  • CombatManager (Listener) — tracks melee hits, awards random power at 100 hits with ActionBar progress every 10 hits

  • DomainSession — tracks participants, original locations, timer, boss bar, spawned entities, shift-used flag

  • DomainManager — full domain lifecycle: start → passive effects → 60s timer → end/early-end; also handles participant removal, participant-count end trigger, entity cleanup, moveDomainParticipants for Teleport GUI

Abilities (all inside active domain, owner only):

Power
Right-click
Shift+Right-click
Domain Passive
🔥 Fire
SmallFireball (6HP + fire, tagged PDC)
None
None
❄ Ice
Snowball (6HP + Slowness II, tagged PDC)
3×3 PackedIce for 7s (one-time)
Freeze all (Slowness 255 + Mining Fatigue 255, 10s)
🌑 Shadow
Invisibility 7s + armor cached/wiped + Blindness+Darkness on others
Strip all effects except Blindness/Darkness (one-time)
Blindness + Darkness on all (10s)
⚡ Teleport
Opens
DomainSelectGUI
→ relocate all to chosen domain
Random teleport every 1s for 10s (Resistance V protects)
Spawn 6 Endermen targeting non-owners, despawn after 10s
💚 Healing
Resistance V + Saturation + Regen III + instant +6HP
Fire 6 harming arrows (one per second, 9HP each, tagged PDC)
Poison all others (10s)

Protection (PowerItemListener): blocks drop, container moves, drag, hopper transfer, and pickup by non-owners

Exploit safety: Player quit/death → removeFromDomain → teleported back → power item kept on death; onDisable ends all sessions cleanly

Setup guide:

  1. Drop the jar into plugins/

  2. Start server — plugins/DomainPower/config.yml and players.yml are created

  3. As OP, stand at each domain arena and run /setdomain fire_power, /setdomain ice_power, etc.

  4. Players get 100 melee hits → random power assigned → /activate to receive item

  5. Right-click item anywhere → domain expands, all online players teleport in for 60s

gamerrajan

Power should be fixed for any player.The power shouldnot be changed even after his power is gone.Power will disappear when it is used one time.To get power, the player again need to hit other players 100 times.Also add custommodeldata to get custom texture packs for powers

Kodari AI
KodariApr 29 at 8:15 am 39,628 (v2)

Now I have a clear picture. Here’s what needs to change:

  • Power type is fixed per player — assignRandomPower must only assign once (never overwrite)

  • Power item is consumed on first domain use — item removed from inventory, but the power type stays in playerPowers

  • 100 hits required to regain the item — track hit counts in PowerManager, give item back at 100

  • CustomModelData — already wired in PowerType + ItemUtil; no change needed there

Now consume the power item when the domain activates:

Now track player-on-player hits in PlayerListener:

Let me add the power_restored message to config.yml:

Here’s a summary of all changes made:

PowerManager.java

  • Added hitCounts map (persisted to players.yml under hits.*) to track per-player hit progress

  • assignRandomPower now only assigns a type once — if the player already has a type it just re-gives the item (never re-rolls the power)

  • consumePowerItem(Player) — removes the item from inventory without touching the power type in playerPowers

  • hasPowerItem(UUID) — checks if the item is physically in the player’s inventory

  • recordHit(UUID) — increments the hit count; at 100 it resets the counter, gives the item back, and sends the restore message; milestone messages shown every 10 hits

AbilityListener.java

  • After startDomain returns true, calls consumePowerItem so the item is consumed on first use

PlayerListener.java

  • Added EntityDamageByEntityEvent handler that calls recordHit whenever a player damages another player

config.yml

  • Added power_restored message key

gamerrajan

If there is only the powerholder except other players or other players except powerholder are left in the domain.They will be directly transported to their previous location even the 60s timer is not over

gamerrajan
📎 1 file 4,127 chars
📄
pasted-code-1777516746859.txt
txt 206 lines
▶
Create a Minecraft plugin called DomainPower.
Author: RajaPlayz_

This plugin introduces an anime-style Domain Expansion combat system where each player has a unique Power that defines their abilities, combat mechanics, domain effects, and visuals.

❗ VERY IMPORTANT DEVELOPMENT RULE

👉 Build the plugin in structured parts (step-by-step modular system), so it can be compiled, tested, and expanded without errors.

Do NOT skip classes
Do NOT merge everything into one file
Ensure each part works before moving to next
Code must be clean, extendable, and error-free
⚙️ REQUIREMENTS
Paper/Spigot 1.21.11
Java 24
Maven project (IntelliJ IDEA ready)

The plugin must be:

Multiplayer-safe
Optimized (no lag)
Exploit-proof
Visually immersive
⚡ POWER SYSTEM

Each player has one permanent power:

🔥 fire_power
❄ ice_power
🌑 shadow_power
⚡ teleport_power
💚 healing_power

🔒 PERMANENT POWER RULE (CRITICAL)
Player gets power only once on first join
Must be saved permanently
Persists after relog, death, restart
Can only change via:
/domain give 
/allpower
🌟 POWER ITEM SYSTEM
Base item: NETHER_STAR
Use CustomModelData (REQUIRED)
🎨 CUSTOM MODEL + PARTICLE REQUIREMENT (VERY IMPORTANT)

👉 Each power MUST have:

A custom model (resource pack)
A unique CustomModelData number

Example (must follow similar structure):

fire_power → CMD: 1001
ice_power → CMD: 1002
shadow_power → CMD: 1003
teleport_power → CMD: 1004
healing_power → CMD: 1005
✨ PARTICLE SYSTEM (HIGH QUALITY – IMPORTANT)

Each power must have custom-designed particle effects, not basic/default spam.

Requirements:
Use multiple particle combinations
Use motion (spiral, circle, wave, orbit)
Smooth animation using scheduler
Examples:

🔥 Fire Power:

Rotating flame ring around player
Flame + smoke trail on movement
Explosion burst particles

❄ Ice Power:

Snow swirl around player
Ice shard particles on attack
Freeze visual effect (block crack particles)

🌑 Shadow Power:

Dark aura (smoke + ash particles)
Flickering shadow effect
Void-like swirl

⚡ Teleport Power:

Ender + portal particles
Flash teleport burst
Trail effect when blinking

💚 Healing Power:

Green spiral particles
Heart particles
Soft glowing aura

👉 Particles must:

Move around player (orbit system)
Be smooth and optimized
Match the theme perfectly
🎮 COMMANDS
/activate
/domain give 
/allpower
/setdomain 
/visitdomain 
/domain power
/domain cooldown
🌌 DOMAIN SYSTEM
Right-click power item → enter domain
Duration: 60 seconds
End:
Return all players
Early end if alone
Must:
Save locations
Restore safely
Reset + repair domain
🔥 FIRE POWER
Right Click: Fireball
Damage: 3 hearts
Cooldown: 25s
Shift + Right Click: Flame Aura
Duration: 6s
Burns enemies
One-time per domain
Domain Passive:
0.5 heart damage every 2s
Fire effect
❄ ICE POWER
Right Click: Snowball Shot
Damage: 3 hearts
Cooldown: 25s
Shift + Right Click: Ice Field
3x3 ice area (7s)
One-time per domain
Domain Passive:
Freeze players 10s
🌑 SHADOW POWER
Right Click: Shadow Veil
Remove lights + invisibility (7s)
Shift + Right Click: Dark Cleanse
Remove effects (except blindness/darkness)
Domain Passive:
Blindness + darkness
⚡ TELEPORT POWER
Right Click: Domain Selector
INVENTORY GUI → teleport all
Shift + Right Click: Blink Mode
Random teleport (10s)
Domain Passive:
Spawn 6 Endermen
💚 HEALING POWER
Right Click: Healing Boost
Resistance + heal
Shift + Right Click: Arrow Barrage
Auto arrows (6s)
Domain Passive:
Poison others
⏱️ COOLDOWN SYSTEM
Show in ActionBar (real-time)
📊 VISUAL SYSTEM
BossBar (domain + cooldown)
Advanced particles (REQUIRED)
Sound effects per ability
🔒 SAFETY + ⚡ PERFORMANCE
Handle logout, death, restart
Prevent exploits + duplication
No lag, optimized schedulers
🧱 STRUCTURE

Managers:

DomainManager
PowerManager
CooldownManager
BossBarManager
DomainLocationManager
CombatManager
📦 CONFIG
domain locations
cooldowns
messages
📤 OUTPUT

Return:

Full plugin structure
All Java classes
plugin.yml
config.yml
Setup guide
Explanation
🎯 FINAL GOAL

Create a plugin that is:

Cinematic
Visually stunning
Modular
Multiplayer-safe
Fully optimized
Expandable
gamerrajan
📎 1 file 1,649 chars
📄
pasted-code-1777517473654.txt
txt 93 lines
▶
🧠 PARTICLE SYSTEM TYPES TO IMPLEMENT
1. 🔄 ORBITING PARTICLES (CORE SYSTEM)
Particles rotate around player
Smooth circular motion
Adjustable radius + speed

Example:

Flame orbit (fire power)
Green aura orbit (healing)
2. 🌪 SPIRAL PARTICLES
Particles move upward in spiral shape
Used for:
power activation
buffs
3. 💥 BURST EFFECT
Explosion-like particle spread
Used for:
ability activation
impact effects
4. ➡ TRAIL EFFECT
Particles follow player/projectile
Smooth trailing motion
5. 🌌 AREA EFFECT (AOE FIELD)
Circular area particles around player
Used for:
aura abilities
domain effects
🎨 POWER-BASED PARTICLE THEMES
🔥 Fire
FLAME
SMOKE
LAVA
Motion: rotating flame ring + explosion burst
❄ Ice
SNOWFLAKE
CLOUD
BLOCK_CRACK (ice)
Motion: swirl + freeze burst
🌑 Shadow
SMOKE
ASH
PORTAL
Motion: flicker + dark swirl
⚡ Teleport
PORTAL
END_ROD
ELECTRIC (spark-like)
Motion: flash + trail
💚 Healing
HEART
VILLAGER_HAPPY
GLOW
Motion: spiral + soft aura
⚙️ TECHNICAL REQUIREMENTS
Use trigonometry:
sin/cos for circle movement
Use tick-based animation (BukkitRunnable)
Control:
radius
speed
particle count
Must avoid:
server lag
excessive particle spam
🧱 STRUCTURE

Create a ParticleManager class with:

playOrbitEffect(Player p)
playSpiralEffect(Location loc)
playBurstEffect(Location loc)
playTrailEffect(Entity e)
playAreaEffect(Location loc)

Make methods reusable for all powers.

📤 OUTPUT

Return:

Full ParticleManager Java class
Example usage in abilities
Explanation of math used
Optimized runnable system
🎯 GOAL

Create particles that feel like:

Anime abilities
Smooth cinematic effects
High-quality visuals
Not basic Minecraft particles
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
30 2,111
src/main/java/com/domainpower/DomainPower.java
package com.domainpower;

import com.domainpower.commands.*;
import com.domainpower.inventory.gui.GUIListener;
import com.domainpower.inventory.gui.GUIManager;
import com.domainpower.listeners.AbilityListener;
import com.domainpower.listeners.PlayerListener;
import com.domainpower.listeners.PowerItemListener;
import com.domainpower.managers.*;
import com.domainpower.util.Keys;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;

public class DomainPower extends JavaPlugin {
    private static DomainPower instance;

    private Keys keys;
    private PowerManager powerManager;
    private CooldownManager cooldownManager;
    private BossBarManager bossBarManager;
    private DomainLocationManager domainLocationManager;
    private CombatManager combatManager;
    private DomainManager domainManager;
    private GUIManager guiManager;

    @Override
    public void onEnable() {
        instance = this;
        saveDefaultConfig();
        getDataFolder().mkdirs();

        keys = new Keys(this);
        bossBarManager = new BossBarManager();
        domainLocationManager = new DomainLocationManager(this);
        powerManager = new PowerManager(this);
        cooldownManager = new CooldownManager();
        domainManager = new DomainManager(this);
        combatManager = new CombatManager(this);
        guiManager = new GUIManager();

        PluginManager pm = getServer().getPluginManager();
        pm.registerEvents(new GUIListener(guiManager), this);
        pm.registerEvents(new PowerItemListener(this), this);
        pm.registerEvents(new PlayerListener(this), this);
        pm.registerEvents(new AbilityListener(this), this);
        pm.registerEvents(combatManager, this);

        getCommand("activate").setExecutor(new ActivateCommand(this));
        getCommand("domain").setExecutor(new DomainCommand(this));
        getCommand("allpower").setExecutor(new AllPowerCommand(this));
        getCommand("setdomain").setExecutor(new SetDomainCommand(this));
        getCommand("visitdomain").setExecutor(new VisitDomainCommand(this));

        getLogger().info("DomainPower enabled! Standing by for domain expansions...");
    }

    @Override
    public void onDisable() {
        powerManager.save();
        domainManager.endAllDomains();
        getLogger().info("DomainPower disabled. All domains collapsed.");
    }

    public static DomainPower getInstance() { return instance; }

    public Keys getKeys() { return keys; }
    public PowerManager getPowerManager() { return powerManager; }
    public CooldownManager getCooldownManager() { return cooldownManager; }
    public BossBarManager getBossBarManager() { return bossBarManager; }
    public DomainLocationManager getDomainLocationManager() { return domainLocationManager; }
    public CombatManager getCombatManager() { return combatManager; }
    public DomainManager getDomainManager() { return domainManager; }
    public GUIManager getGuiManager() { return guiManager; }
}