mahinuddin
📎 1 file 7,568 chars
📄
GodWeapons_Part1.txt
txt 164 lines
▶
You are an expert Minecraft plugin developer specializing in Paper API development.
Your task is to generate a COMPLETE, PRODUCTION-READY Minecraft plugin called "GodWeapons".
Do NOT truncate, summarize, or skip any code. Output every single class in full.
Do NOT say "rest of code omitted" or "similar to above" anywhere.
Do NOT use placeholder comments like "// add ability here".
Every ability must be FULLY IMPLEMENTED in working Java code.
THIS IS PART 1 OF 2. After I send Part 2, then begin generating all files.
Do NOT generate any code yet. Just reply "Part 1 received. Send Part 2."

═══════════════════════════════════════════════
VERSION & COMPATIBILITY
═══════════════════════════════════════════════
Primary Target: Minecraft 1.21.1 (Paper)
Also works on: 1.20.x, 1.20.4, 1.20.6, 1.21, 1.21.1
Language: Java 21 | Build: Maven
API: Paper API (io.papermc.paper.* + org.bukkit.*)

CRITICAL RULES:
- Enchantment.SHARPNESS not DAMAGE_ALL
- Enchantment.SWEEPING_EDGE not SWEEPING
- Particle.EXPLOSION not EXPLOSION_LARGE
- Particle.HAPPY_VILLAGER not VILLAGER_HAPPY
- Particle.ITEM with ItemStack data not ITEM_CRACK
- AttributeInstance for max health, NOT setMaxHealth()
- NO entity.setMetadata — use PersistentDataContainer
- Wolf.setOwner(player) for taming
- player.sendActionBar(Component) from Adventure API
- plugin.yml api-version: "1.21"
- pom.xml: Java 21, Paper 1.21.1-R0.1-SNAPSHOT
- Sound: ENTITY_LIGHTNING_BOLT_THUNDER not ENTITY_LIGHTNING_THUNDER

═══════════════════════════════════════════════
PLUGIN IDENTITY
═══════════════════════════════════════════════
Plugin Name: GodWeapons
Main: com.godweapons.GodWeapons
Package: com.godweapons

═══════════════════════════════════════════════
ALL 19 REQUIRED FILES
═══════════════════════════════════════════════
1.  pom.xml
2.  src/main/resources/plugin.yml
3.  src/main/resources/config.yml
4.  src/main/java/com/godweapons/GodWeapons.java
5.  src/main/java/com/godweapons/managers/WeaponManager.java
6.  src/main/java/com/godweapons/managers/CooldownManager.java
7.  src/main/java/com/godweapons/managers/CraftManager.java
8.  src/main/java/com/godweapons/managers/WeaponLimitManager.java
9.  src/main/java/com/godweapons/INVENTORY GUI/UpgradeGUI.java
10. src/main/java/com/godweapons/weapons/SunLord.java
11. src/main/java/com/godweapons/weapons/NatureLord.java
12. src/main/java/com/godweapons/weapons/IceQueenBlade.java
13. src/main/java/com/godweapons/weapons/LightningLord.java
14. src/main/java/com/godweapons/weapons/VoidLord.java
15. src/main/java/com/godweapons/listeners/WeaponListener.java
16. src/main/java/com/godweapons/listeners/CraftListener.java
17. src/main/java/com/godweapons/listeners/GUIListener.java
18. src/main/java/com/godweapons/util/WeaponUtils.java
19. src/main/java/com/godweapons/enums/WeaponType.java
    Enum values: SUN_LORD, NATURE_LORD, ICE_QUEEN_BLADE, LIGHTNING_LORD, VOID_LORD

═══════════════════════════════════════════════
WEAPON 1 — SUN LORD (Fire / Holy)
═══════════════════════════════════════════════
TIER 1:
- Active (right-click): Fire Beam — shoot SmallFireball at nearest entity in 20 blocks,
  deal 8 damage, set on fire for 160 ticks
- AOE: Solar Flare — all LivingEntities in 5 blocks: set fire 120 ticks, deal 6 damage,
  spawn FLAME + LAVA particles
- Passive (EntityDamageByEntityEvent): every hit sets target on fire for 100 ticks
- Cooldown: 45s | Key: "sun_active", "sun_aoe"

TIER 2:
- Active: Enhanced Fire Beam — 15 damage to nearest in 20 blocks,
  apply BLINDNESS amp 1 for 60t, WITHER amp 0 for 60t,
  spawn FLAME spiral particles around target
- AOE: Meteor Shower — BukkitRunnable every 10t x5: spawn Fireball from 10 blocks above
  random spot in 10-block radius, yield 1.5f, LAVA particles at zone
- Passive (PlayerMoveEvent): set block below player to FIRE, restore to AIR after 10t
- Cooldown: 30s

TIER 3 GOD MODE:
- Active: Supernova — all entities in 20 blocks: 40 damage, fire 200t,
  velocity Vector(random -2 to 2, 3.0, random -2 to 2),
  spawn EXPLOSION x50, play ENTITY_GENERIC_EXPLODE
- AOE (EntityDamageByEntityEvent): Holy Inferno — on every sword hit,
  spawn FLAME wall 3-wide in facing direction, set arc blocks to FIRE briefly
- Passive (EntityDamageByEntityEvent): reflect 50% damage to attacker,
  spawn FLAME on attacker
- Ultimate (sneak+right-click): Sun Shield — PDC flag "sun_shield_active"=true,
  cancel all damage while active, after 100t: remove flag, deal 20 dmg + BLINDNESS amp 2
  to all in 25 blocks, massive FLAME+LAVA burst
- Cooldown: 20s | Key: "sun_ultimate"

═══════════════════════════════════════════════
WEAPON 2 — NATURE LORD (Poison / Heal / Summon)
═══════════════════════════════════════════════
TIER 1:
- Active: Vine Strike — nearest in 15 blocks: 6 damage, SLOWNESS amp 4 for 60t,
  HAPPY_VILLAGER particles
- AOE: Healing Aura — REGENERATION amp 1 for 160t to player + allies in 8 blocks,
  HEART particles
- Passive: every hit applies POISON amp 1 for 80t to target
- Cooldown: 45s

TIER 2:
- Active: Entangle — all in 8 blocks: 12 damage each, SLOWNESS amp 4 for 100t,
  SLIME particles per target
- AOE: Nature's Wrath — spawn 3 Wolves tamed to player (wolf.setOwner(player)),
  wolf HP=40 via AttributeInstance, POISON amp 2 for 100t to enemies in 6 blocks,
  HAPPY_VILLAGER particles
- Passive (EntityDeathEvent): if killer holds Nature Lord Tier 2,
  heal player 8 HP: setHealth(min(health+8, maxHealth))
- Cooldown: 30s

TIER 3 GOD MODE:
- Active: Nature Titan — spawn IronGolem, setBaseValue(200) for MAX_HEALTH,
  setHealth(200), store owner UUID in golem PDC "nature_titan_owner",
  repeating task every 20t: golem.getPathfinder().moveTo(nearestEnemy)
- AOE: Living World — all enemies in 20 blocks: SLOWNESS amp 3 + POISON amp 2 for 200t,
  player gets SPEED amp 2 + STRENGTH amp 1 for 400t,
  HAPPY_VILLAGER + HEART particles
- Passive: REGENERATION amp 2 every 40t, cancel POISON damage to player
- Ultimate (sneak+right-click): World Tree — 8 Wolves + 2 IronGolems (200HP each),
  player full heal, STRENGTH amp 2 for 600t, massive HEART+HAPPY_VILLAGER explosion
- Cooldown: 20s

═══════════════════════════════════════════════
WEAPON 3 — ICE QUEEN BLADE (Freeze / Control)
═══════════════════════════════════════════════
TIER 1:
- Active: Freeze Beam — nearest in 20 blocks: 6 damage,
  SLOWNESS amp 4 + MINING_FATIGUE amp 2 for 80t, SNOWFLAKE particles
- AOE: Ice Spike — all in 6 blocks: SLOWNESS amp 3 for 80t,
  SNOWFLAKE + CLOUD particles
- Passive: every hit applies SLOWNESS amp 1 for 60t
- Cooldown: 45s

TIER 2:
- Active: Ice Prison — nearest in 20 blocks: 10 damage,
  SLOWNESS amp 9 + MINING_FATIGUE amp 4 for 120t,
  SNOWFLAKE cage particle pattern via for loops
- AOE: Blizzard — all in 12 blocks: SLOWNESS amp 4 + BLINDNESS amp 0 for 100t,
  dense SNOWFLAKE + CLOUD particles across radius
- Passive (EntityDamageEvent): if victim is this player,
  event.setDamage(event.getDamage() * 0.7) — 30% reduction
- Cooldown: 30s

TIER 3 GOD MODE:
- Active: Absolute Zero — all in 20 blocks: 25 damage,
  SLOWNESS amp 9 + MINING_FATIGUE amp 9 for 60t,
  dense SNOWFLAKE sphere particles
- AOE: Ice Immortality Shield — PDC flag "ice_shield_active",
  cancel all damage while active, SNOWFLAKE+CLOUD sphere every 10t,
  remove after 160t
- Passive: attacker gets SLOWNESS amp 4 for 60t automatically
- Ultimate (sneak+right-click): Time Stop — ALL entities ALL worlds:
  SLOWNESS amp 9 + MINING_FATIGUE amp 9 for 80t,
  player gets SPEED amp 4 for 80t,
  after 80t: deal 30 damage to all still-slowed entities,
  SNOWFLAKE explosion globally
- Cooldown: 20s
Kodari AI
KodariMay 30 at 10:24 am 7
GodWeapons
A powerful Minecraft plugin featuring 5 legendary god weapons across 3 tiers each. Weapons include SunLord (fire/holy), NatureLord (poison/heal/summon), IceQueenBlade (freeze/control), LightningLord, and VoidLord. Each weapon has unique active, AOE, passive, and ultimate abilities with cooldown management, custom crafting recipes, an upgrade GUI, and weapon limit enforcement.

I only received Part 1. Send Part 2 and I’ll generate all files once I have the complete spec.

mahinuddin
📎 1 file 11,813 chars
📄
GodWeapons_Part2.txt
txt 298 lines
▶
THIS IS PART 2 OF 2. Now you have everything. Generate all 19 files completely.
Do NOT stop early. Do NOT truncate. Do NOT use placeholder comments.

═══════════════════════════════════════════════
WEAPON 4 — LIGHTNING LORD (Speed / Chain)
═══════════════════════════════════════════════
TIER 1:
- Active: Lightning Strike — nearest in 20 blocks:
  world.strikeLightningEffect(location), entity.damage(10, player),
  ELECTRIC_SPARK particles
- AOE: Chain Lightning — 4 nearest in 15 blocks: strikeLightningEffect each,
  7 damage each, stagger 10t apart via BukkitRunnable chain,
  ELECTRIC_SPARK particles
- Passive (PlayerItemHeldEvent): equip = SPEED amp 1 for 999999t,
  unequip = remove speed effect
- Cooldown: 45s

TIER 2:
- Active: Storm Strike — nearest in 20 blocks: 3 bolts with 10t gaps via BukkitRunnable,
  each bolt: strikeLightningEffect + 12 damage, ELECTRIC_SPARK + CRIT particles
- AOE: Thunder Clap — all in 10 blocks: velocity(random -1.5 to 1.5, 2.5, random -1.5 to 1.5),
  strikeLightningEffect each, SLOWNESS amp 1 for 60t scheduled 40t later
- Passive: 20% chance on hit: strikeLightningEffect on target + 8 extra damage
- Cooldown: 30s

TIER 3 GOD MODE:
- Active: Storm God Mode — PDC flag "storm_mode_active",
  SPEED amp 3 + RESISTANCE amp 1 for 300t,
  PlayerMoveEvent: strikeLightningEffect at player every 5 moves while active,
  cancel Projectile damage to player while active,
  remove flag after 300t
- AOE: Endless Chain — ALL entities in 20 blocks: strikeLightningEffect + 10 damage each,
  stagger 5t per entity via BukkitRunnable counter
- Passive (EntityDamageEvent LIGHTNING cause): cancel damage,
  heal 10 HP, STRENGTH amp 1 for 200t
- Ultimate (sneak+right-click): Ragnarok — all entities in 30 blocks,
  repeating task 20 iterations x 5t intervals:
  random entity from list: strikeLightningEffect + 15 damage,
  ELECTRIC_SPARK + WHITE_ASH particles,
  play ENTITY_LIGHTNING_BOLT_THUNDER at strike location
- Cooldown: 20s

═══════════════════════════════════════════════
WEAPON 5 — VOID LORD (Teleport / Reality Erase)
═══════════════════════════════════════════════
TIER 1:
- Active: Void Strike — nearest in 20 blocks: teleport player 2 blocks behind target,
  deal 10 damage, PORTAL particles at origin+destination,
  play ENTITY_ENDERMAN_TELEPORT
- AOE: Gravity Pull — all in 10 blocks: vector from entity to player,
  normalize * 2.5, setVelocity, PORTAL particles around player
- Passive: 15% dodge on incoming damage: cancel event,
  teleport player 3 blocks random horizontal direction,
  actionbar "§b[VOID] §fDodged!"
- Cooldown: 45s

TIER 2:
- Active: Dimension Rip — nearest in 20 blocks:
  teleport target to location.add(0,15,0), let them fall (no return),
  PORTAL + DRAGON_BREATH particles at origin + destination
- AOE: Black Hole — all in 8 blocks: pull toward player,
  15 damage, LEVITATION amp 1 for 60t,
  PORTAL swirl particles
- Passive: on taking damage: INVISIBILITY amp 0 for 60t,
  PORTAL particles at player location
- Cooldown: 30s

TIER 3 GOD MODE:
- Active: Reality Erase — nearest in 20 blocks:
  store original location, teleport to (x, -64, z),
  40 damage, WITHER amp 2 for 200t,
  after 40t: teleport back to original location,
  massive DRAGON_BREATH particles
- AOE: Void Collapse — repeating BukkitRunnable every 20t x 8 iterations:
  all in 15 blocks: pull toward player, 5 damage,
  PORTAL + REVERSE_PORTAL particles, cancel after 8 runs
- Passive: 30% dodge: cancel damage, teleport 5 blocks opposite of attacker,
  PORTAL particles at both locations
- Ultimate (sneak+right-click): Oblivion —
  INVISIBILITY amp 0 + RESISTANCE amp 4 for 120t to player,
  BLINDNESS amp 0 + DARKNESS amp 0 for 120t to all in 20 blocks,
  after 120t: 50 damage to all in 12 blocks,
  massive PORTAL + DRAGON_BREATH + REVERSE_PORTAL explosion,
  play ENTITY_WITHER_SHOOT + ENTITY_ENDERMAN_TELEPORT
- Cooldown: 20s

═══════════════════════════════════════════════
CRAFTING SYSTEM
═══════════════════════════════════════════════
Register 5 shaped recipes in CraftManager via Bukkit.addRecipe()
Pattern for ALL weapons: ["ABA", "CDC", "ABA"]
D = NETHERITE_SWORD always (center)

Sun Lord:       A=FIRE_CHARGE,    B=NETHER_STAR,    C=BLAZE_ROD
Nature Lord:    A=VINE,           B=LILY_PAD,       C=EMERALD
Ice Queen:      A=PACKED_ICE,     B=BLUE_ICE,       C=PRISMARINE_CRYSTALS
Lightning Lord: A=COPPER_BLOCK,   B=GOLD_BLOCK,     C=LIGHTNING_ROD
Void Lord:      A=ENDER_PEARL,    B=END_CRYSTAL,    C=CRYING_OBSIDIAN

PrepareItemCraftEvent: check WeaponLimitManager.isWeaponAvailable(type)
If unavailable: set result to AIR, show title "§cWeapon limit reached!"

PDC on crafted item:
  "godweapon_type"  -> STRING  -> e.g. "SUN_LORD"
  "godweapon_tier"  -> INTEGER -> 1
  "godweapon_id"    -> STRING  -> UUID.randomUUID().toString()
  "godweapon_owner" -> STRING  -> crafter UUID string

═══════════════════════════════════════════════
UPGRADE INVENTORY GUI SYSTEM
═══════════════════════════════════════════════
Command: /godweapon upgrade
27-slot chest inventory:
  Slot 13: current weapon display (non-interactive clone)
  Slot 11: BOOK showing required materials in lore
  Slot 15: GREEN_STAINED_GLASS_PANE "§a§lCONFIRM UPGRADE"
  All other slots: GRAY_STAINED_GLASS_PANE " "

Tier 1 -> Tier 2 cost: 5x DIAMOND + 2x GOLD_BLOCK + 1x NETHER_STAR
Tier 2 -> Tier 3 cost: 5x NETHERITE_INGOT + 3x NETHER_STAR + 1x DRAGON_EGG

On slot 15 click:
  1. Check inventory.containsAtLeast() for required items
  2. If missing: "§cInsufficient materials!", close INVENTORY GUI
  3. If ok: removeItem(), update PDC tier++, rename item, update lore,
     add new tier enchantments, send success message

═══════════════════════════════════════════════
WEAPON LIMIT MANAGER
═══════════════════════════════════════════════
EnumMap tracking:
- scanAllPlayers() on enable
- PlayerJoinEvent: scan inventory
- PlayerQuitEvent: free slot if had weapon
- PlayerDropItemEvent: update (item still exists)
- EntityPickupItemEvent: update
- PlayerDeathEvent: keep tracked (item dropped)
- ItemDespawnEvent: free slot if god weapon

Methods:
  boolean isWeaponAvailable(WeaponType type)
  void registerWeapon(WeaponType type)
  void unregisterWeapon(WeaponType type)

═══════════════════════════════════════════════
COOLDOWN MANAGER
═══════════════════════════════════════════════
Map> cooldowns

boolean isOnCooldown(UUID, String key)
void setCooldown(UUID, String key, int seconds)
long getRemainingSeconds(UUID, String key)
void sendCooldownMessage(Player, String abilityName, long remaining):
  player.sendActionBar(Component.text("§c[COOLDOWN] §f" + name + " — §e" + remaining + "s"))

Keys: "sun_active","sun_aoe","sun_ultimate",
      "nature_active","nature_aoe","nature_ultimate",
      "ice_active","ice_aoe","ice_ultimate",
      "lightning_active","lightning_aoe","lightning_ultimate",
      "void_active","void_aoe","void_ultimate"

Tier cooldowns: Tier1=45s, Tier2=30s, Tier3=20s

═══════════════════════════════════════════════
WEAPON UTILS — PDC KEYS
═══════════════════════════════════════════════
NamespacedKey fields (init with plugin instance):
  KEY_TYPE, KEY_TIER, KEY_ID, KEY_OWNER,
  KEY_SUN_SHIELD, KEY_ICE_SHIELD, KEY_STORM_MODE, KEY_TITAN_OWNER

Helper methods:
  boolean isGodWeapon(ItemStack item)
  WeaponType getWeaponType(ItemStack item)
  int getWeaponTier(ItemStack item)
  boolean hasFlag(Entity, NamespacedKey)
  void setFlag(Entity, NamespacedKey, boolean)
  LivingEntity getNearestEnemy(Player, double radius)
  List getEnemiesInRadius(Player, double radius)

═══════════════════════════════════════════════
ITEM APPEARANCE
═══════════════════════════════════════════════
Material: NETHERITE_SWORD, setUnbreakable(true)
Use Adventure API: displayName(Component), lore(List)

Tier names (adjust colors per weapon):
  Tier 1: "§6§lSun Lord §e[Tier I]"
  Tier 2: "§6§lSun Lord §c[Tier II]"
  Tier 3: "§6§lSun Lord §4§l[TIER III — GOD MODE]"

All tiers: SHARPNESS 5
Tier 2 adds: FIRE_ASPECT 2, KNOCKBACK 2
Tier 3 adds: LOOTING 3, SWEEPING_EDGE 3, UNBREAKING 3

Lore lines:
  "" (blank)
  "§7Tier X Weapon"
  "§e⚡ Active: [name]"
  "§a● AOE: [name]"
  "§b◆ Passive: [name]"
  "§c★ Ultimate: [name]" (Tier 3 only)
  "" (blank)
  "§8Right-click to activate"
  "§8Shift+Right-click for ULTIMATE" (Tier 3 only)

═══════════════════════════════════════════════
PARTICLES (1.21 verified)
═══════════════════════════════════════════════
Sun Lord: FLAME, LAVA, EXPLOSION
Nature Lord: HAPPY_VILLAGER, SLIME, HEART
Ice Queen: SNOWFLAKE, CLOUD, ITEM (with PACKED_ICE ItemStack)
Lightning Lord: ELECTRIC_SPARK, CRIT, WHITE_ASH
Void Lord: PORTAL, DRAGON_BREATH, REVERSE_PORTAL

ITEM particle syntax:
  world.spawnParticle(Particle.ITEM, loc, count, dx, dy, dz, spd, new ItemStack(Material.PACKED_ICE))

═══════════════════════════════════════════════
SOUNDS (1.21 verified)
═══════════════════════════════════════════════
Sun Lord: ENTITY_BLAZE_SHOOT, ENTITY_LIGHTNING_BOLT_THUNDER
Nature Lord: BLOCK_GRASS_BREAK, ENTITY_WOLF_HOWL
Ice Queen: BLOCK_GLASS_BREAK, ENTITY_PLAYER_HURT
Lightning Lord: ENTITY_LIGHTNING_BOLT_THUNDER, ENTITY_CREEPER_PRIMED
Void Lord: ENTITY_ENDERMAN_TELEPORT, ENTITY_WITHER_SHOOT

═══════════════════════════════════════════════
COMMANDS
═══════════════════════════════════════════════
/godweapon give     — permission: godweapons.admin
  weapon values: sunlord, naturelord, icequeenblade, lightninglord, voidlord
/godweapon upgrade    — open INVENTORY GUI for held weapon
/godweapon list       — list active weapons + availability
/godweapon reload     — permission: godweapons.admin

═══════════════════════════════════════════════
MAIN CLASS onEnable() ORDER
═══════════════════════════════════════════════
1. saveDefaultConfig()
2. WeaponUtils.init(plugin)
3. new CooldownManager()
4. new WeaponLimitManager(plugin)
5. new WeaponManager(plugin, limitManager)
6. new CraftManager(plugin, weaponManager, limitManager)
7. new UpgradeGUI(plugin, weaponManager)
8. Register: WeaponListener, CraftListener, GUIListener
9. Register command "godweapon"
10. limitManager.scanAllPlayers()
11. log "[GodWeapons] Enabled!"

onDisable(): log "[GodWeapons] Disabled."
Provide static getInstance()

═══════════════════════════════════════════════
pom.xml
═══════════════════════════════════════════════
groupId: com.godweapons
artifactId: GodWeapons
version: 1.0.0
Java: 21 (source + target)
Paper API: io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT:provided
Repo: https://repo.papermc.io/repository/maven-public/
Plugins: maven-compiler-plugin (Java 21), maven-shade-plugin (fat jar)

═══════════════════════════════════════════════
plugin.yml
═══════════════════════════════════════════════
name: GodWeapons
version: 1.0.0
main: com.godweapons.GodWeapons
api-version: "1.21"
commands:
  godweapon:
    description: GodWeapons main command
    usage: /godweapon 
permissions:
  godweapons.admin:
    default: op

═══════════════════════════════════════════════
FINAL OUTPUT RULES
═══════════════════════════════════════════════
Label every file:
  === FILE: pom.xml ===
  === FILE: src/main/resources/plugin.yml ===
  === FILE: src/main/java/com/godweapons/GodWeapons.java ===

Rules:
- Output ALL 19 files. Do NOT skip any.
- Do NOT truncate any file mid-way.
- No "// similar to above", no "// see SunLord", no placeholder comments.
- Every ability = real working Java: loops, BukkitRunnables, damage(), particles, PDC.
- Null-check all targets before using them.
- Cancel all BukkitRunnables when done.
- Use Adventure API (Component.text) for ALL player-facing text.
- If output is cut off, user will type "continue" — resume exactly where stopped.
- End with summary table: File | Approx Lines | Status: COMPLETE
Kodari AI
KodariMay 30 at 10:37 am 94
GodWeapons
A Minecraft Paper plugin featuring 5 legendary god weapons (SunLord, NatureLord, IceQueenBlade, LightningLord, VoidLord) each with 3 tiers of escalating power. Each weapon has unique active, AOE, passive, and ultimate abilities. Includes cooldown management, custom shaped crafting recipes, an upgrade GUI, weapon limit tracking, and full admin commands for giving/managing weapons.

Planning all 19 files before writing a single line:

  • WeaponUtils — static helper, initialized first; all other classes depend on it

  • WeaponType enum — no dependencies

  • CooldownManager — depends on nothing

  • WeaponLimitManager — depends on WeaponType, WeaponUtils

  • WeaponManager — depends on WeaponUtils, WeaponType; creates weapon items

  • CraftManager — depends on WeaponManager, WeaponLimitManager

  • UpgradeGUI — depends on WeaponManager, WeaponUtils (uses GUI framework inline)

  • Weapon classes (5) — depend on WeaponUtils, CooldownManager

  • WeaponListener — depends on all 5 weapon classes

  • CraftListener — depends on CraftManager, WeaponLimitManager

  • GUIListener — depends on UpgradeGUI

  • GodWeapons main — wires everything together

The WeaponListener move handler for storm mode has a fragile classloader trick — let me fix that by injecting the plugin reference properly:Good — the file is already correct. Now creating the remaining listeners and main class:

Now let me output all 19 files completely:

=== FILE: pom.xml ===

=== FILE: src/main/resources/plugin.yml ===

=== FILE: src/main/resources/config.yml ===

=== FILE: src/main/java/com/godweapons/enums/WeaponType.java ===

=== FILE: src/main/java/com/godweapons/util/WeaponUtils.java ===

=== FILE: src/main/java/com/godweapons/managers/CooldownManager.java ===

=== FILE: src/main/java/com/godweapons/managers/WeaponLimitManager.java ===

=== FILE: src/main/java/com/godweapons/managers/WeaponManager.java ===

=== FILE: src/main/java/com/godweapons/managers/CraftManager.java ===

=== FILE: src/main/java/com/godweapons/gui/UpgradeGUI.java ===

=== FILE: src/main/java/com/godweapons/weapons/SunLord.java ===

=== FILE: src/main/java/com/godweapons/weapons/NatureLord.java ===

=== FILE: src/main/java/com/godweapons/weapons/IceQueenBlade.java ===

=== FILE: src/main/java/com/godweapons/weapons/LightningLord.java ===

=== FILE: src/main/java/com/godweapons/weapons/VoidLord.java ===

=== FILE: src/main/java/com/godweapons/listeners/WeaponListener.java ===

=== FILE: src/main/java/com/godweapons/listeners/CraftListener.java ===

=== FILE: src/main/java/com/godweapons/listeners/GUIListener.java ===

=== FILE: src/main/java/com/godweapons/GodWeapons.java ===


File
Approx Lines
Status
pom.xml
60
✅ COMPLETE
plugin.yml
18
✅ COMPLETE
config.yml
16
✅ COMPLETE
GodWeapons.java
145
✅ COMPLETE
WeaponManager.java
145
✅ COMPLETE
CooldownManager.java
50
✅ COMPLETE
CraftManager.java
90
✅ COMPLETE
WeaponLimitManager.java
120
✅ COMPLETE
UpgradeGUI.java
160
✅ COMPLETE
SunLord.java
200
✅ COMPLETE
NatureLord.java
195
✅ COMPLETE
IceQueenBlade.java
200
✅ COMPLETE
LightningLord.java
210
✅ COMPLETE
VoidLord.java
215
✅ COMPLETE
WeaponListener.java
220
✅ COMPLETE
CraftListener.java
75
✅ COMPLETE
GUIListener.java
35
✅ COMPLETE
WeaponUtils.java
100
✅ COMPLETE
WeaponType.java
10
✅ COMPLETE

All 19 files generated. Build with mvn package — the shaded jar lands in target/. Drop into your Paper 1.21.1 plugins/ folder. AOE abilities trigger on left-click, actives on right-click, ultimates on sneak + right-click.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
19 2,783
src/main/java/com/godweapons/GodWeapons.java
package com.godweapons;

import com.godweapons.enums.WeaponType;
import com.godweapons.gui.UpgradeGUI;
import com.godweapons.listeners.CraftListener;
import com.godweapons.listeners.GUIListener;
import com.godweapons.listeners.WeaponListener;
import com.godweapons.managers.*;
import com.godweapons.util.WeaponUtils;
import com.godweapons.weapons.*;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;

public class GodWeapons extends JavaPlugin {

    private static GodWeapons instance;

    private CooldownManager cooldownManager;
    private WeaponLimitManager limitManager;
    private WeaponManager weaponManager;
    private CraftManager craftManager;
    private UpgradeGUI upgradeGUI;

    private SunLord sunLord;
    private NatureLord natureLord;
    private IceQueenBlade iceQueenBlade;
    private LightningLord lightningLord;
    private VoidLord voidLord;

    @Override
    public void onEnable() {
        instance = this;

        // 1. Config
        saveDefaultConfig();

        // 2. Utils
        WeaponUtils.init(this);

        // 3. Managers
        cooldownManager = new CooldownManager();
        limitManager = new WeaponLimitManager(this);
        weaponManager = new WeaponManager(this, limitManager);
        craftManager = new CraftManager(this, weaponManager, limitManager);

        // 4. Weapon instances
        sunLord = new SunLord(this, cooldownManager);
        natureLord = new NatureLord(this, cooldownManager);
        iceQueenBlade = new IceQueenBlade(this, cooldownManager);
        lightningLord = new LightningLord(this, cooldownManager);
        voidLord = new VoidLord(this, cooldownManager);

        // 5. GUI
        upgradeGUI = new UpgradeGUI(this, weaponManager);

        // 6. Register listeners
        WeaponListener weaponListener = new WeaponListener(
                sunLord, natureLord, iceQueenBlade, lightningLord, voidLord, cooldownManager
        );
        Bukkit.getPluginManager().registerEvents(weaponListener, this);
        Bukkit.getPluginManager().registerEvents(new CraftListener(weaponManager, limitManager), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(upgradeGUI), this);

        // 7. Register command
        getCommand("godweapon").setExecutor(this);

        // 8. Scan existing players
        limitManager.scanAllPlayers();

        // 9. Nature Lord tier 3 passive regen task (every 40t for online players holding NL T3)
        new BukkitRunnable() {
            @Override
            public void run() {
                for (Player p : Bukkit.getOnlinePlayers()) {
                    ItemStack item = p.getInventory().getItemInMainHand();
                    if (!WeaponUtils.isGodWeapon(item)) continue;
                    if (WeaponUtils.getWeaponType(item) == WeaponType.NATURE_LORD
                            && WeaponUtils.getWeaponTier(item) == 3) {
                        natureLord.tier3PassiveRegen(p);
                    }
                }
            }
        }.runTaskTimer(this, 40L, 40L);

        getLogger().info("[GodWeapons] Enabled!");
    }

    @Override
    public void onDisable() {
        getLogger().info("[GodWeapons] Disabled.");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!command.getName().equalsIgnoreCase("godweapon")) return false;

        if (args.length == 0) {
            sender.sendMessage(Component.text("§6[GodWeapons] §fUsage: /godweapon <give|upgrade|list|reload>"));
            return true;
        }

        switch (args[0].toLowerCase()) {
            case "give" -> {
                if (!sender.hasPermission("godweapons.admin")) {
                    sender.sendMessage(Component.text("§cNo permission."));
                    return true;
                }
                if (args.length < 4) {
                    sender.sendMessage(Component.text("§cUsage: /godweapon give <player> <weapon> <tier>"));
                    return true;
                }
                Player target = Bukkit.getPlayer(args[1]);
                if (target == null) {
                    sender.sendMessage(Component.text("§cPlayer not found: " + args[1]));
                    return true;
                }
                WeaponType type = parseWeaponType(args[2]);
                if (type == null) {
                    sender.sendMessage(Component.text("§cUnknown weapon: " + args[2]
                            + ". Use: sunlord, naturelord, icequeenblade, lightninglord, voidlord"));
                    return true;
                }
                int tier;
                try {
                    tier = Integer.parseInt(args[3]);
                    if (tier < 1 || tier > 3) throw new NumberFormatException();
                } catch (NumberFormatException e) {
                    sender.sendMessage(Component.text("§cTier must be 1, 2, or 3."));
                    return true;
                }
                ItemStack weapon = weaponManager.createWeapon(type, tier, target.getUniqueId());
                target.getInventory().addItem(weapon);
                limitManager.registerWeapon(type);
                sender.sendMessage(Component.text("§aGave " + type.name() + " Tier " + tier + " to " + target.getName()));
                target.sendMessage(Component.text("§6[GodWeapons] §fYou received a §6" + type.name() + " §fTier " + tier + "!"));
            }
            case "upgrade" -> {
                if (!(sender instanceof Player player)) {
                    sender.sendMessage(Component.text("§cOnly players can use this command."));
                    return true;
                }
                upgradeGUI.openFor(player);
            }
            case "list" -> {
                sender.sendMessage(Component.text("§6[GodWeapons] §fWeapon Status:"));
                for (WeaponType type : WeaponType.values()) {
                    boolean available = limitManager.isWeaponAvailable(type);
                    String status = available ? "§aAvailable" : "§cIn World";
                    sender.sendMessage(Component.text("  §7" + type.name() + ": " + status));
                }
            }
            case "reload" -> {
                if (!sender.hasPermission("godweapons.admin")) {
                    sender.sendMessage(Component.text("§cNo permission."));
                    return true;
                }
                reloadConfig();
                limitManager.scanAllPlayers();
                sender.sendMessage(Component.text("§a[GodWeapons] Config reloaded and weapons rescanned."));
            }
            default -> sender.sendMessage(Component.text("§cUnknown subcommand. Use: give, upgrade, list, reload"));
        }
        return true;
    }

    private WeaponType parseWeaponType(String input) {
        return switch (input.toLowerCase()) {
            case "sunlord", "sun_lord" -> WeaponType.SUN_LORD;
            case "naturelord", "nature_lord" -> WeaponType.NATURE_LORD;
            case "icequeenblade", "ice_queen_blade" -> WeaponType.ICE_QUEEN_BLADE;
            case "lightninglord", "lightning_lord" -> WeaponType.LIGHTNING_LORD;
            case "voidlord", "void_lord" -> WeaponType.VOID_LORD;
            default -> null;
        };
    }

    public static GodWeapons getInstance() {
        return instance;
    }

    public CooldownManager getCooldownManager() { return cooldownManager; }
    public WeaponLimitManager getLimitManager() { return limitManager; }
    public WeaponManager getWeaponManager() { return weaponManager; }
    public UpgradeGUI getUpgradeGUI() { return upgradeGUI; }
}