📄
pasted-code-1788999001254.txt
txt
141 lines
▶
Write a complete, production-ready, highly optimized Paper Minecraft plugin for version **1.21.11** named **Souls SMP**. Use modern Java (Java 21) APIs, clean component-based Adventure API text formatting, and robust event handling. Do not use placeholder comments for damage numbers or particle loops; write out the full math formulas, vector calculations, and `LivingEntity#damage(double, Entity)` methods.
### CRITICAL ADMIN & PLAYER COMMAND IMPLEMENTATION PRIORITY:
*All of the following commands must be fully implemented, registered in `plugin.yml`, and properly restricted by permission nodes (`souls.admin` for admin commands):*
* **`/withdraw [amount]`** (Player Command) - Allows players to take souls out of their pool and turn them into physical Soul items, provided they have enough balance.
* **`/weapons view`** (ADMIN ONLY - requires `souls.admin`) - Opens a GUI displaying all 11 mythic weapons rendered in **bold text** with their respective theme-matching gradient colors; clicking one adds it to the player's inventory.
* **`/weapons give [player name] [weapon name]`** (ADMIN ONLY - requires `souls.admin`) - Directly gives a specific mythic weapon to a player.
* **`/soul give [player name] [amount]`** (ADMIN ONLY - requires `souls.admin`) - Grants souls to a specific player's balance.
* **`/soul revive [player name]`** (ADMIN ONLY - requires `souls.admin`) - Directly revives and unbans a soul-banned player.
* **`/crafting revivebeacon [enable|disable]`** (ADMIN ONLY - requires `souls.admin`) - Admin toggle command (default: enabled) to control whether players can craft the revive beacon.
---
### Core Requirements & Features to Implement:
#### 1. Souls System & Mechanics
* **Starting Souls:** Every player who joins for the first time starts with **10 souls**. Max soul capacity per player is **20 souls**.
* **PVP Drops:** When Player A kills Player B, Player B loses 1 soul, and a physical "Soul" item drops on the ground.
* **Soul Item:** Crafted from a **Nether Star** with `CustomModelData: 1`, rendered in **bold text** with an ethereal soul gradient color (`#00FFFF` to `#0080FF` - Cyan to Deep Blue), and right-clicking it consumes it to add +1 soul to the player's balance.
* **Soul Ban:** If a player drops to 0 souls, they are automatically banned from the server with a customized ban screen.
#### 2. Revival System & GUI
* **Soul Revive Beacon:** A vanilla Beacon item configured with a custom crafting recipe, rendered in **bold text** with a glowing revival gradient color (`#00FF7F` to `#1E90FF` - Spring Green to Dodger Blue).
* **Revival GUI:** Right-clicking the unplaced Soul Revive Beacon opens an inventory GUI featuring skeleton skulls representing each currently soul-banned player. Clicking a skull revives that player, resets their soul count to 1, unbans them, and consumes the beacon.
#### 3. Custom Crafting Recipes
* **Soul Recipe:** Shaped crafting recipe using a Nether Star in the center surrounded by Echo Shards and Soul Sand.
* **Soul Revive Beacon Recipe:** Shaped crafting recipe using a Nether Star in the center, surrounded by Totems of Undying and Crying Obsidian blocks.
#### 4. Custom Mythic Weapons (11 Total Weapons) & Damage Scaling
Every weapon must calculate exact server-side damage through `EntityDamageByEntityEvent` using these scaling formulas:
* **Legendary Tier Weapons (Voidbreaker, Solaris, Worldrender - CMD 1):** Base attack damage of **14.0 (7 hearts)** + **2.0 damage per kill** tracked on the item (capped at +40 bonus damage / 20 kills).
* **Standard Mythic Tier Weapons (Bloodthorn, Eclipse Blade, etc. - CMD 2-8):** Base attack damage of **11.0 (5.5 hearts)** + **1.0 damage per kill** tracked on the item (capped at +15 bonus damage / 15 kills).
* **Lock to Hand:** Active abilities must execute directly via activation keys (`OFFHAND`, `RIGHT CLICK`, `OFFHAND+CROUCH`, `SHIFT+LEFT CLICK`, `SHIFT+RIGHT CLICK`) without requiring the player to swap the weapon out of their main hand. All active abilities have responsive cooldowns strictly balanced **between 10 seconds and 30 seconds**.
##### **Weapon Distribution & Type Breakdown (11 Total):**
* **1 Legendary Mace** (`CustomModelData: 1`) — 5 Active Abilities + 1 Passive
* **1 Legendary Netherite Sword** (`CustomModelData: 1`) — 5 Active Abilities + 1 Passive
* **1 Legendary Netherite Axe** (`CustomModelData: 1`) — 5 Active Abilities + 1 Passive
* **7 Standard Netherite Swords** (`CustomModelData: 2 to 8`) — Standard Mythic (3 Active Abilities + 1 Passive each)
* **1 Standard Netherite Axe** (`CustomModelData: 2`) — Standard Mythic (3 Active Abilities + 1 Passive)
##### **Activation Layout Rules for All Weapons**
* **Standard Mythic Weapons (8 Total — 7 Netherite Swords, 1 Netherite Axe):** Each features **3 Unique Active Combat Abilities + 1 Passive**.
- Passive: 0 Kills
- 1st Ability (`OFFHAND`): 0 Kills (No kill requirement)
- 2nd Ability (`RIGHT CLICK`): Kill progression required (2 Kills)
- 3rd Ability (`OFFHAND+CROUCH`): Kill progression required (4 Kills)
* **Legendary Tier Weapons (3 Total — 1 Mace, 1 Netherite Sword, 1 Netherite Axe):** Each features **5 Unique Active Combat Abilities + 1 Passive**.
- Passive: 0 Kills
- 1st Ability (`OFFHAND`): 0 Kills (No kill requirement)
- 2nd Ability (`RIGHT CLICK`): Kill progression required (1 Kill)
- 3rd Ability (`OFFHAND+CROUCH`): Kill progression required (3 Kills)
- 4th Ability (`SHIFT+LEFT CLICK`): Kill progression required (5 Kills)
- 5th Ability (`SHIFT+RIGHT CLICK`): Kill progression required (7 Kills)
---
##### **Legendary Tier 1 (3 Terrifying Weapons — 5 Active Abilities + 1 Passive Each)**
1. **Voidbreaker (Legendary Mace — CMD 1)** — Rendered in **bold text** with a dark void gradient color (`#4B0082` to `#8A2BE2` - Indigo to Violet)
- **PASSIVE (0 Kills):** *CATACLYSMIC AURA* - Radiates a repeating `BukkitRunnable` pulse of `DRIPPING_OBSIDIAN_TEAR` and `ASH` particles; grants permanent Resistance II and local panic slowness to nearby enemies.
- **1st Ability (0 Kills | 12s Cooldown | `OFFHAND`):** *TITANIC SHOCKWAVE* - Smash the ground to send out a radial wave of `SONIC_BOOM` and `EXPLOSION` particles. Deals **12.0 damage** and flings enemies 15 blocks into the air.
- **2nd Ability (1 Kill | 18s Cooldown | `RIGHT CLICK`):** *DOOMSDAY METEOR* - Summon a cascade of 3 falling `FLAME` and `EXPLOSION_EMITTER` meteors onto crosshairs. Deals **16.0 direct impact damage**.
- **3rd Ability (3 Kills | 14s Cooldown | `OFFHAND+CROUCH`):** *GRAVITATIONAL CRUSH* - Pulses an intense gravity beam of `BLOCK_CRACK` and `DUST` downwards, slamming all surrounding targets into the floor. Deals **14.0 damage** and paralyzes targets with 6s Slowness IV and Weakness III.
- **4th Ability (5 Kills | 24s Cooldown | `SHIFT+LEFT CLICK`):** *WORLD FRACTURE* - Unleash a linear rupture of consecutive `SONIC_BOOM` shockwaves. Deals **20.0 damage**, strips shields, and fractures armor durability.
- **5th Ability (7 Kills | 30s Cooldown | `SHIFT+RIGHT CLICK`):** *SINGULARITY OF EXTINCTION* - Open a particle vortex of `PORTAL` and `REVERSE_ENCHANTMENT_TABLE` pulling targets inward. Deals **25.0 damage** and instantly executes anyone below 30% health.
2. **Solaris (Legendary Netherite Sword — CMD 1)** — Rendered in **bold text** with a blazing solar gradient color (`#FF4500` to `#FFD700` - Orange Red to Gold)
- **PASSIVE (0 Kills):** *APOCALYPTIC SUPERNOVA* - Wreathed in a corona of `LAVA` and `END_ROD` particles; attackers within 5 blocks take **2.0 fire damage/sec** and permanent Blindness.
- **1st Ability (0 Kills | 10s Cooldown | `OFFHAND`):** *SOLAR SLASH* - Unleash a crescent wave of `SOUL_FIRE_FLAME`. Deals **12.0 damage** and sets targets ablaze for 8 seconds.
- **2nd Ability (1 Kill | 16s Cooldown | `RIGHT CLICK`):** *HEAVENLY DEATH BEAM* - Fire a pillar beam of searing `FLASH` and `FLAME` particles. Deals **16.0 true damage**, bypassing shields.
- **3rd Ability (3 Kills | 15s Cooldown | `OFFHAND+CROUCH`):** *SOLAR FLARE PRISON* - Erects a blazing cage barrier of `DRIPPING_LAVA` fire walls around target areas that silence enemy ability usage and deal **13.0 damage**.
- **4th Ability (5 Kills | 22s Cooldown | `SHIFT+LEFT CLICK`):** *SOLAR FLARE PURGE* - Explode outward in a white `FIREWORK` particle sphere. Deals **18.0 AOE damage**, incinerates projectiles, and blinds screens.
- **5th Ability (7 Kills | 30s Cooldown | `SHIFT+RIGHT CLICK`):** *WRATH OF THE SUN GOD* - Plunge sky into darkness with a grid matrix of 9 descending solar pillars (`FLASH` particles) in a 15-block radius. Deals **25.0 devastation damage**.
3. **Worldrender (Legendary Netherite Axe — CMD 1)** — Rendered in **bold text** with a blood-red destruction gradient color (`#8B0000` to `#FF0000` - Dark Red to Red)
- **PASSIVE (0 Kills):** *MONSTER OF RUIN* - Emits blood-red `ANGRY_VILLAGER` and `DUST` shockwaves via task loops; grants permanent Strength II.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *REALITY REND* - Cleave an arc of pulsing `LAVA` and `CRIT` particles. Deals **12.0 damage** and applies Levitation for 3 seconds.
- **2nd Ability (1 Kill | 20s Cooldown | `RIGHT CLICK`):** *INFERNAL WHIRLWIND* - Spin in a 360-degree vortex of `LARGE_SMOKE` and `SOUL_FIRE_FLAME`. Deals **16.0 AOE damage** and reflects projectiles.
- **3rd Ability (3 Kills | 16s Cooldown | `OFFHAND+CROUCH`):** *GROUND ZERO STRIKE* - Slams the earth with an obsidian shockwave of `BLOCK_CRACK` fragments. Deals **15.0 damage** and roots enemies in place.
- **4th Ability (5 Kills | 25s Cooldown | `SHIFT+LEFT CLICK`):** *ABYSSAL VORTEX* - Summon a tornado storm of crimson `DUST` and `CAMPFIRE_SIGNAL_SMOKE`. Lifts and slams targets for **20.0 impact damage**.
- **5th Ability (7 Kills | 30s Cooldown | `SHIFT+RIGHT CLICK`):** *CATACLYSMIC EXECUTION* - Discharge 3 overlapping waves of `SONIC_BOOM` and `EXPLOSION_EMITTER` shockwaves. Deals **25.0 damage** and instantly executes center targets.
---
##### **Standard Mythic Tier 2 (8 Weapons — 3 Active Abilities + 1 Passive Each)**
*Netherite Swords (7 Variants — CMD 2 to 8)*
4. **Bloodthorn (Netherite Sword — CMD 2)** — Rendered in **bold text** with a crimson blood gradient (`#800020` to `#FF1493` - Burgundy to Deep Pink)
- **PASSIVE (0 Kills):** *VAMPIRISM* - Emits crimson blood droplets via `DUST` particle wisps; lifesteals **15%** of melee damage dealt.
- **1st Ability (0 Kills | 12s Cooldown | `OFFHAND`):** *BLEEDING SPIKE* - Fires a piercing thorn with `DAMAGE_INDICATOR` particle trail. Deals **8.0 damage** and inflicts deep wounds.
- **2nd Ability (2 Kills | 20s Cooldown | `RIGHT CLICK`):** *BLOOD SURGE* - Pulses `HEART` particles outward granting 6s rapid regeneration.
- **3rd Ability (4 Kills | 16s Cooldown | `OFFHAND+CROUCH`):** *THORN WEAVE TRAP* - Spikes up a web pattern of dark wood and `BLOCK_CRACK` root vines directly beneath targets. Deals **10.0 damage** and immobilizes enemies.
5. **Eclipse Blade (Netherite Sword — CMD 3)** — Rendered in **bold text** with an eclipse dark shadow gradient (`#2F4F4F` to `#000000` - Dark Slate Gray to Black)
- **PASSIVE (0 Kills):** *UMBRA* - Shrouded in dark void mist using `SMOKE` and `REVERSE_ENCHANTMENT_TABLE` particles; grants invisibility in low light.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *SHADOW STEP STRIKE* - Teleports directly behind target enemy in a wisp of black `SQUID_INK` residue. Deals **9.0 surprise damage**.
- **2nd Ability (2 Kills | 18s Cooldown | `RIGHT CLICK`):** *TOTAL ECLIPSE* - Casts localized darkness in a 6-block radius. Deals **10.0 damage** and silences item abilities.
- **3rd Ability (4 Kills | 26s Cooldown | `OFFHAND+CROUCH`):** *VOID ASSAULT* - Multi-hit phantom strike barrage using `PORTAL` particles. Deals **14.0 total damage**.
6. **Soulreaper (Netherite Sword — CMD 4)** — Rendered in **bold text** with a soul-fire blue gradient (`#00FFFF` to `#00008B` - Cyan to Dark Blue)
- **PASSIVE (0 Kills):** *NECRO AURA* - Ghostly `SOUL` particles surround wielder; melee hits steal 1 XP and deal **1.5 necrotic damage**.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *SOUL SIPHON* - Launches spectral `SOUL_FIRE_FLAME` projectile. Deals **8.0 damage** and cripples speed.
- **2nd Ability (2 Kills | 22s Cooldown | `RIGHT CLICK`):** *DEATH WAVE* - Expanding ring of `SCULK_SOUL` particles. Deals **12.0 decay damage**.
- **3rd Ability (4 Kills | 18s Cooldown | `OFFHAND+CROUCH`):** *PHANTOM DOMINION* - Summons a ghostly realm dome pattern (`PORTAL` & `SOUL`) over target area. Deals **11.0 damage** and inflicts Blindness.
7. **Warpblade (Netherite Sword — CMD 5)** — Rendered in **bold text** with a dimensional purple gradient (`#9400D3` to `#DA70D6` - Dark Violet to Orchid)
- **PASSIVE (0 Kills):** *SPATIAL SHIFT* - Purple `DRAGON_BREATH` and `PORTAL` sparkles; grants permanent Speed II.
- **1st Ability (0 Kills | 12s Cooldown | `OFFHAND`):** *DIMENSIONAL STRIKE* - Discharges a warp beam forward through entities leaving an ender trail. Deals **9.0 damage**.
- **2nd Ability (2 Kills | 20s Cooldown | `RIGHT CLICK`):** *RIFT COLLAPSE* - Snaps targets back to previous location using `REVERSE_ENCHANTMENT_TABLE` particles. Deals **11.0 damage**.
- **3rd Ability (4 Kills | 28s Cooldown | `OFFHAND+CROUCH`):** *DIMENSIONAL PRISM* - Encases target in a particle prism cage locking movement for 3.5 seconds. Deals **13.0 damage**.
8. **Stormsever (Netherite Sword — CMD 6)** — Rendered in **bold text** with an electric yellow-blue storm gradient (`#00BFFF` to `#FFFF00` - Deep Sky Blue to Yellow)
- **PASSIVE (0 Kills):** *THUNDER CHARGE* - Sparks with `ELECTRIC_SPARK` particles; grants lightning immunity.
- **1st Ability (0 Kills | 15s Cooldown | `OFFHAND`):** *LIGHTNING SLASH* - Horizontal arc of `ELECTRIC_SPARK` and `CRIT` particles. Deals **9.0 piercing damage**.
- **2nd Ability (2 Kills | 24s Cooldown | `RIGHT CLICK`):** *STATIC DISCHARGE* - High-frequency shock radial of `CLOUD` and `ELECTRIC_SPARK`. Deals **12.0 damage** and disarms off-hands.
- **3rd Ability (4 Kills | 20s Cooldown | `OFFHAND+CROUCH`):** *TEMPEST STRIKE* - Calls down a localized overhead storm beam directly onto target. Deals **12.0 shock damage** and knocks targets back.
9. **Infernal Dreadblade (Netherite Sword — CMD 7)** — Rendered in **bold text** with a fiery nether flame gradient (`#FF4500` to `#FF8C00` - Orange Red to Dark Orange)
- **PASSIVE (0 Kills):** *NETHER BURST* - Continuous `LAVA` droplets; melee attacks double burn duration.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *HELLFIRE SLASH* - Wave of dense `FLAME` and `SMOKE` particles. Deals **9.0 fire damage** and ignites enemies.
- **2nd Ability (2 Kills | 22s Cooldown | `RIGHT CLICK`):** *MAGMA RING* - Expanding ground ring of boiling `LAVA` and `FLAME`. Deals **12.0 damage** and degrades armor durability.
- **3rd Ability (4 Kills | 18s Cooldown | `OFFHAND+CROUCH`):** *INFERNAL ERUPTION* - Erupts violent flame geysers beneath enemy feet marked with burning `CAMPFIRE_COSY_SMOKE` columns. Deals **11.0 damage**.
10. **Glacial Sunder (Netherite Sword — CMD 8)** — Rendered in **bold text** with an icy frost gradient (`#E0FFFF` to `#1E90FF` - Light Cyan to Dodger Blue)
- **PASSIVE (0 Kills):** *FROSTBITE AURA* - Frost mist `SNOWFLAKE` particle trail; severely slows attackers on hit.
- **1st Ability (0 Kills | 16s Cooldown | `OFFHAND`):** *CRYOFREEZE* - Crystal beam of `SNOWFLAKE` and `WHITE_ASH`. Freezes target solid for 2.5s and deals **8.0 damage**.
- **2nd Ability (2 Kills | 25s Cooldown | `RIGHT CLICK`):** *ICE SHARD BARRAGE* - Launches 7 sharp ice projectiles (`ITEM_SNOWBALL`). Deals **12.0 total damage**.
- **3rd Ability (4 Kills | 20s Cooldown | `OFFHAND+CROUCH`):** *GLACIAL DOMAIN* - Freezes surrounding ground into an 8-block ice sheet, dropping target speed to zero and dealing **10.0 damage**.
*Netherite Axe (1 Variant — CMD 2)*
11. **Berserker's Dreadaxe (Netherite Axe — CMD 2)** — Rendered in **bold text** with a fierce berserker rage gradient (`#8B0000` to `#FF8C00` - Dark Red to Dark Orange)
- **PASSIVE (0 Kills):** *BLOOD LUST* - Aggressive `ANGRY_VILLAGER` and `DAMAGE_INDICATOR` wisps; grants permanent Resistance II when below 50% HP.
- **1st Ability (0 Kills | 15s Cooldown | `OFFHAND`):** *CLEAVE SLAM* - Downward slam with `CRIT` and `BLOCK_CRACK` stone fragments. Deals **10.0 shockwave damage**.
- **2nd Ability (2 Kills | 24s Cooldown | `RIGHT CLICK`):** *SHIELD SHREDDER* - Impact flash burst (`FLASH` particles). Shatters shields instantly, disables shielding for 6s, and deals **13.0 damage**.
- **3rd Ability (4 Kills | 18s Cooldown | `OFFHAND+CROUCH`):** *WAR CRY BLAST* - Emits a massive circular shockwave pattern of `CAMPFIRE_SIGNAL_SMOKE` particles outward. Deals **12.0 damage** and applies Weakness III.
#### 6. Stacked Boss Bar Cooldown Tracker
* Whenever a weapon ability is triggered, display a custom **Boss Bar** to the wielder showing the weapon name formatted in **bold text** with its matching theme gradient color, ability name, and remaining cooldown.
* Support **multiple stacked boss bars** simultaneously if multiple weapon abilities are cooling down at the same time. more things i want to add :-Also make the recipe for the soul and the revive beacon editable via a chest GUI: an admin runs /1crafting soul, opening a chest GUI with 9 empty slots in the center for crafting inputs and all other slots filled with glass panes, plus a green glass pane save button that saves the recipe directly upon clicking. Same functionality for the revive beacon via /1crafting revive. Make sure off-hand abilities activate when pressing the off-hand key without the item moving into the off-hand slot (it stays firmly in the main hand), same for shift + off-hand. Add an admin command /level up that instantly levels up the mythic weapon currently held in hand to the next level without requiring player kills. Make all weapons completely unbreakable (they will not take durability damage), and give all weapons except mace Sharpness 5 all the commands i said in this is admin command except the /withdraw command like in the whole prompt and also when somebody dies on 9 soul like they lost 9 soul and then get killed by a player again they will drop the 10th soul and then get banned until someone revives him if he got like 20 souls and then dies 19 times like when somebody have 1 soul left and then gets killed by a player they will drop the last soul and then get bans like death banned and when someone gets killed by a player that time the one who got killed by the player drops the soul otherwise they don't drop and even when someone uses withdraw command then have 1 soul left and then gets killed by a player that time they drop the soul and then gets banned
Build the Paper 1.21.11 plugin foundation, metadata, configuration, and command registration.
Implement soul balances, PvP soul drops, bans/revival, custom items, recipes, and editable recipe GUIs.
Implement all 11 weapons, kill scaling, unbreakable/Sharpness behavior, activation handling, passives, abilities, and stacked cooldown bars.
Wire listeners, persistence, admin/player commands, and GUI interactions together.
Created the Souls SMP Paper plugin project with:
Soul balances, PvP soul drops, physical Soul items, soul bans, revival, withdrawal, and configurable limits.
Editable Soul and Revive Beacon recipes through
/1crafting souland/1crafting revive.Revival GUI with banned-player skulls and beacon consumption.
All 11 mythic weapons with custom model data, kill-based damage scaling, Sharpness 5, unbreakable durability, passives, abilities, off-hand activation, and cooldown boss bars.
Admin commands:
/weapons view/weapons give/soul give/soul revive/crafting revivebeacon/1crafting/level up
Player command:
/withdraw
Java 21, Paper API, Adventure components, XSeries compatibility, persistence, recipes, GUIs, and event handling.
the lore is not like in the prompt so i am giving the prompt again without the thing i said "the more thing i want to add:-"
📄
pasted-code-1789001000436.txt
txt
141 lines
▶
Write a complete, production-ready, highly optimized Paper Minecraft plugin for version **1.21.11** named **Souls SMP**. Use modern Java (Java 21) APIs, clean component-based Adventure API text formatting, and robust event handling. Do not use placeholder comments for damage numbers or particle loops; write out the full math formulas, vector calculations, and `LivingEntity#damage(double, Entity)` methods.
### CRITICAL ADMIN & PLAYER COMMAND IMPLEMENTATION PRIORITY:
*All of the following commands must be fully implemented, registered in `plugin.yml`, and properly restricted by permission nodes (`souls.admin` for admin commands):*
* **`/withdraw [amount]`** (Player Command) - Allows players to take souls out of their pool and turn them into physical Soul items, provided they have enough balance.
* **`/weapons view`** (ADMIN ONLY - requires `souls.admin`) - Opens a GUI displaying all 11 mythic weapons rendered in **bold text** with their respective theme-matching gradient colors; clicking one adds it to the player's inventory.
* **`/weapons give [player name] [weapon name]`** (ADMIN ONLY - requires `souls.admin`) - Directly gives a specific mythic weapon to a player.
* **`/soul give [player name] [amount]`** (ADMIN ONLY - requires `souls.admin`) - Grants souls to a specific player's balance.
* **`/soul revive [player name]`** (ADMIN ONLY - requires `souls.admin`) - Directly revives and unbans a soul-banned player.
* **`/crafting revivebeacon [enable|disable]`** (ADMIN ONLY - requires `souls.admin`) - Admin toggle command (default: enabled) to control whether players can craft the revive beacon.
---
### Core Requirements & Features to Implement:
#### 1. Souls System & Mechanics
* **Starting Souls:** Every player who joins for the first time starts with **10 souls**. Max soul capacity per player is **20 souls**.
* **PVP Drops:** When Player A kills Player B, Player B loses 1 soul, and a physical "Soul" item drops on the ground.
* **Soul Item:** Crafted from a **Nether Star** with `CustomModelData: 1`, rendered in **bold text** with an ethereal soul gradient color (`#00FFFF` to `#0080FF` - Cyan to Deep Blue), and right-clicking it consumes it to add +1 soul to the player's balance.
* **Soul Ban:** If a player drops to 0 souls, they are automatically banned from the server with a customized ban screen.
#### 2. Revival System & GUI
* **Soul Revive Beacon:** A vanilla Beacon item configured with a custom crafting recipe, rendered in **bold text** with a glowing revival gradient color (`#00FF7F` to `#1E90FF` - Spring Green to Dodger Blue).
* **Revival GUI:** Right-clicking the unplaced Soul Revive Beacon opens an inventory GUI featuring skeleton skulls representing each currently soul-banned player. Clicking a skull revives that player, resets their soul count to 1, unbans them, and consumes the beacon.
#### 3. Custom Crafting Recipes
* **Soul Recipe:** Shaped crafting recipe using a Nether Star in the center surrounded by Echo Shards and Soul Sand.
* **Soul Revive Beacon Recipe:** Shaped crafting recipe using a Nether Star in the center, surrounded by Totems of Undying and Crying Obsidian blocks.
#### 4. Custom Mythic Weapons (11 Total Weapons) & Damage Scaling
Every weapon must calculate exact server-side damage through `EntityDamageByEntityEvent` using these scaling formulas:
* **Legendary Tier Weapons (Voidbreaker, Solaris, Worldrender - CMD 1):** Base attack damage of **14.0 (7 hearts)** + **2.0 damage per kill** tracked on the item (capped at +40 bonus damage / 20 kills).
* **Standard Mythic Tier Weapons (Bloodthorn, Eclipse Blade, etc. - CMD 2-8):** Base attack damage of **11.0 (5.5 hearts)** + **1.0 damage per kill** tracked on the item (capped at +15 bonus damage / 15 kills).
* **Lock to Hand:** Active abilities must execute directly via activation keys (`OFFHAND`, `RIGHT CLICK`, `OFFHAND+CROUCH`, `SHIFT+LEFT CLICK`, `SHIFT+RIGHT CLICK`) without requiring the player to swap the weapon out of their main hand. All active abilities have responsive cooldowns strictly balanced **between 10 seconds and 30 seconds**.
##### **Weapon Distribution & Type Breakdown (11 Total):**
* **1 Legendary Mace** (`CustomModelData: 1`) — 5 Active Abilities + 1 Passive
* **1 Legendary Netherite Sword** (`CustomModelData: 1`) — 5 Active Abilities + 1 Passive
* **1 Legendary Netherite Axe** (`CustomModelData: 1`) — 5 Active Abilities + 1 Passive
* **7 Standard Netherite Swords** (`CustomModelData: 2 to 8`) — Standard Mythic (3 Active Abilities + 1 Passive each)
* **1 Standard Netherite Axe** (`CustomModelData: 2`) — Standard Mythic (3 Active Abilities + 1 Passive)
##### **Activation Layout Rules for All Weapons**
* **Standard Mythic Weapons (8 Total — 7 Netherite Swords, 1 Netherite Axe):** Each features **3 Unique Active Combat Abilities + 1 Passive**.
- Passive: 0 Kills
- 1st Ability (`OFFHAND`): 0 Kills (No kill requirement)
- 2nd Ability (`RIGHT CLICK`): Kill progression required (2 Kills)
- 3rd Ability (`OFFHAND+CROUCH`): Kill progression required (4 Kills)
* **Legendary Tier Weapons (3 Total — 1 Mace, 1 Netherite Sword, 1 Netherite Axe):** Each features **5 Unique Active Combat Abilities + 1 Passive**.
- Passive: 0 Kills
- 1st Ability (`OFFHAND`): 0 Kills (No kill requirement)
- 2nd Ability (`RIGHT CLICK`): Kill progression required (1 Kill)
- 3rd Ability (`OFFHAND+CROUCH`): Kill progression required (3 Kills)
- 4th Ability (`SHIFT+LEFT CLICK`): Kill progression required (5 Kills)
- 5th Ability (`SHIFT+RIGHT CLICK`): Kill progression required (7 Kills)
---
##### **Legendary Tier 1 (3 Terrifying Weapons — 5 Active Abilities + 1 Passive Each)**
1. **Voidbreaker (Legendary Mace — CMD 1)** — Rendered in **bold text** with a dark void gradient color (`#4B0082` to `#8A2BE2` - Indigo to Violet)
- **PASSIVE (0 Kills):** *CATACLYSMIC AURA* - Radiates a repeating `BukkitRunnable` pulse of `DRIPPING_OBSIDIAN_TEAR` and `ASH` particles; grants permanent Resistance II and local panic slowness to nearby enemies.
- **1st Ability (0 Kills | 12s Cooldown | `OFFHAND`):** *TITANIC SHOCKWAVE* - Smash the ground to send out a radial wave of `SONIC_BOOM` and `EXPLOSION` particles. Deals **12.0 damage** and flings enemies 15 blocks into the air.
- **2nd Ability (1 Kill | 18s Cooldown | `RIGHT CLICK`):** *DOOMSDAY METEOR* - Summon a cascade of 3 falling `FLAME` and `EXPLOSION_EMITTER` meteors onto crosshairs. Deals **16.0 direct impact damage**.
- **3rd Ability (3 Kills | 14s Cooldown | `OFFHAND+CROUCH`):** *GRAVITATIONAL CRUSH* - Pulses an intense gravity beam of `BLOCK_CRACK` and `DUST` downwards, slamming all surrounding targets into the floor. Deals **14.0 damage** and paralyzes targets with 6s Slowness IV and Weakness III.
- **4th Ability (5 Kills | 24s Cooldown | `SHIFT+LEFT CLICK`):** *WORLD FRACTURE* - Unleash a linear rupture of consecutive `SONIC_BOOM` shockwaves. Deals **20.0 damage**, strips shields, and fractures armor durability.
- **5th Ability (7 Kills | 30s Cooldown | `SHIFT+RIGHT CLICK`):** *SINGULARITY OF EXTINCTION* - Open a particle vortex of `PORTAL` and `REVERSE_ENCHANTMENT_TABLE` pulling targets inward. Deals **25.0 damage** and instantly executes anyone below 30% health.
2. **Solaris (Legendary Netherite Sword — CMD 1)** — Rendered in **bold text** with a blazing solar gradient color (`#FF4500` to `#FFD700` - Orange Red to Gold)
- **PASSIVE (0 Kills):** *APOCALYPTIC SUPERNOVA* - Wreathed in a corona of `LAVA` and `END_ROD` particles; attackers within 5 blocks take **2.0 fire damage/sec** and permanent Blindness.
- **1st Ability (0 Kills | 10s Cooldown | `OFFHAND`):** *SOLAR SLASH* - Unleash a crescent wave of `SOUL_FIRE_FLAME`. Deals **12.0 damage** and sets targets ablaze for 8 seconds.
- **2nd Ability (1 Kill | 16s Cooldown | `RIGHT CLICK`):** *HEAVENLY DEATH BEAM* - Fire a pillar beam of searing `FLASH` and `FLAME` particles. Deals **16.0 true damage**, bypassing shields.
- **3rd Ability (3 Kills | 15s Cooldown | `OFFHAND+CROUCH`):** *SOLAR FLARE PRISON* - Erects a blazing cage barrier of `DRIPPING_LAVA` fire walls around target areas that silence enemy ability usage and deal **13.0 damage**.
- **4th Ability (5 Kills | 22s Cooldown | `SHIFT+LEFT CLICK`):** *SOLAR FLARE PURGE* - Explode outward in a white `FIREWORK` particle sphere. Deals **18.0 AOE damage**, incinerates projectiles, and blinds screens.
- **5th Ability (7 Kills | 30s Cooldown | `SHIFT+RIGHT CLICK`):** *WRATH OF THE SUN GOD* - Plunge sky into darkness with a grid matrix of 9 descending solar pillars (`FLASH` particles) in a 15-block radius. Deals **25.0 devastation damage**.
3. **Worldrender (Legendary Netherite Axe — CMD 1)** — Rendered in **bold text** with a blood-red destruction gradient color (`#8B0000` to `#FF0000` - Dark Red to Red)
- **PASSIVE (0 Kills):** *MONSTER OF RUIN* - Emits blood-red `ANGRY_VILLAGER` and `DUST` shockwaves via task loops; grants permanent Strength II.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *REALITY REND* - Cleave an arc of pulsing `LAVA` and `CRIT` particles. Deals **12.0 damage** and applies Levitation for 3 seconds.
- **2nd Ability (1 Kill | 20s Cooldown | `RIGHT CLICK`):** *INFERNAL WHIRLWIND* - Spin in a 360-degree vortex of `LARGE_SMOKE` and `SOUL_FIRE_FLAME`. Deals **16.0 AOE damage** and reflects projectiles.
- **3rd Ability (3 Kills | 16s Cooldown | `OFFHAND+CROUCH`):** *GROUND ZERO STRIKE* - Slams the earth with an obsidian shockwave of `BLOCK_CRACK` fragments. Deals **15.0 damage** and roots enemies in place.
- **4th Ability (5 Kills | 25s Cooldown | `SHIFT+LEFT CLICK`):** *ABYSSAL VORTEX* - Summon a tornado storm of crimson `DUST` and `CAMPFIRE_SIGNAL_SMOKE`. Lifts and slams targets for **20.0 impact damage**.
- **5th Ability (7 Kills | 30s Cooldown | `SHIFT+RIGHT CLICK`):** *CATACLYSMIC EXECUTION* - Discharge 3 overlapping waves of `SONIC_BOOM` and `EXPLOSION_EMITTER` shockwaves. Deals **25.0 damage** and instantly executes center targets.
---
##### **Standard Mythic Tier 2 (8 Weapons — 3 Active Abilities + 1 Passive Each)**
*Netherite Swords (7 Variants — CMD 2 to 8)*
4. **Bloodthorn (Netherite Sword — CMD 2)** — Rendered in **bold text** with a crimson blood gradient (`#800020` to `#FF1493` - Burgundy to Deep Pink)
- **PASSIVE (0 Kills):** *VAMPIRISM* - Emits crimson blood droplets via `DUST` particle wisps; lifesteals **15%** of melee damage dealt.
- **1st Ability (0 Kills | 12s Cooldown | `OFFHAND`):** *BLEEDING SPIKE* - Fires a piercing thorn with `DAMAGE_INDICATOR` particle trail. Deals **8.0 damage** and inflicts deep wounds.
- **2nd Ability (2 Kills | 20s Cooldown | `RIGHT CLICK`):** *BLOOD SURGE* - Pulses `HEART` particles outward granting 6s rapid regeneration.
- **3rd Ability (4 Kills | 16s Cooldown | `OFFHAND+CROUCH`):** *THORN WEAVE TRAP* - Spikes up a web pattern of dark wood and `BLOCK_CRACK` root vines directly beneath targets. Deals **10.0 damage** and immobilizes enemies.
5. **Eclipse Blade (Netherite Sword — CMD 3)** — Rendered in **bold text** with an eclipse dark shadow gradient (`#2F4F4F` to `#000000` - Dark Slate Gray to Black)
- **PASSIVE (0 Kills):** *UMBRA* - Shrouded in dark void mist using `SMOKE` and `REVERSE_ENCHANTMENT_TABLE` particles; grants invisibility in low light.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *SHADOW STEP STRIKE* - Teleports directly behind target enemy in a wisp of black `SQUID_INK` residue. Deals **9.0 surprise damage**.
- **2nd Ability (2 Kills | 18s Cooldown | `RIGHT CLICK`):** *TOTAL ECLIPSE* - Casts localized darkness in a 6-block radius. Deals **10.0 damage** and silences item abilities.
- **3rd Ability (4 Kills | 26s Cooldown | `OFFHAND+CROUCH`):** *VOID ASSAULT* - Multi-hit phantom strike barrage using `PORTAL` particles. Deals **14.0 total damage**.
6. **Soulreaper (Netherite Sword — CMD 4)** — Rendered in **bold text** with a soul-fire blue gradient (`#00FFFF` to `#00008B` - Cyan to Dark Blue)
- **PASSIVE (0 Kills):** *NECRO AURA* - Ghostly `SOUL` particles surround wielder; melee hits steal 1 XP and deal **1.5 necrotic damage**.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *SOUL SIPHON* - Launches spectral `SOUL_FIRE_FLAME` projectile. Deals **8.0 damage** and cripples speed.
- **2nd Ability (2 Kills | 22s Cooldown | `RIGHT CLICK`):** *DEATH WAVE* - Expanding ring of `SCULK_SOUL` particles. Deals **12.0 decay damage**.
- **3rd Ability (4 Kills | 18s Cooldown | `OFFHAND+CROUCH`):** *PHANTOM DOMINION* - Summons a ghostly realm dome pattern (`PORTAL` & `SOUL`) over target area. Deals **11.0 damage** and inflicts Blindness.
7. **Warpblade (Netherite Sword — CMD 5)** — Rendered in **bold text** with a dimensional purple gradient (`#9400D3` to `#DA70D6` - Dark Violet to Orchid)
- **PASSIVE (0 Kills):** *SPATIAL SHIFT* - Purple `DRAGON_BREATH` and `PORTAL` sparkles; grants permanent Speed II.
- **1st Ability (0 Kills | 12s Cooldown | `OFFHAND`):** *DIMENSIONAL STRIKE* - Discharges a warp beam forward through entities leaving an ender trail. Deals **9.0 damage**.
- **2nd Ability (2 Kills | 20s Cooldown | `RIGHT CLICK`):** *RIFT COLLAPSE* - Snaps targets back to previous location using `REVERSE_ENCHANTMENT_TABLE` particles. Deals **11.0 damage**.
- **3rd Ability (4 Kills | 28s Cooldown | `OFFHAND+CROUCH`):** *DIMENSIONAL PRISM* - Encases target in a particle prism cage locking movement for 3.5 seconds. Deals **13.0 damage**.
8. **Stormsever (Netherite Sword — CMD 6)** — Rendered in **bold text** with an electric yellow-blue storm gradient (`#00BFFF` to `#FFFF00` - Deep Sky Blue to Yellow)
- **PASSIVE (0 Kills):** *THUNDER CHARGE* - Sparks with `ELECTRIC_SPARK` particles; grants lightning immunity.
- **1st Ability (0 Kills | 15s Cooldown | `OFFHAND`):** *LIGHTNING SLASH* - Horizontal arc of `ELECTRIC_SPARK` and `CRIT` particles. Deals **9.0 piercing damage**.
- **2nd Ability (2 Kills | 24s Cooldown | `RIGHT CLICK`):** *STATIC DISCHARGE* - High-frequency shock radial of `CLOUD` and `ELECTRIC_SPARK`. Deals **12.0 damage** and disarms off-hands.
- **3rd Ability (4 Kills | 20s Cooldown | `OFFHAND+CROUCH`):** *TEMPEST STRIKE* - Calls down a localized overhead storm beam directly onto target. Deals **12.0 shock damage** and knocks targets back.
9. **Infernal Dreadblade (Netherite Sword — CMD 7)** — Rendered in **bold text** with a fiery nether flame gradient (`#FF4500` to `#FF8C00` - Orange Red to Dark Orange)
- **PASSIVE (0 Kills):** *NETHER BURST* - Continuous `LAVA` droplets; melee attacks double burn duration.
- **1st Ability (0 Kills | 14s Cooldown | `OFFHAND`):** *HELLFIRE SLASH* - Wave of dense `FLAME` and `SMOKE` particles. Deals **9.0 fire damage** and ignites enemies.
- **2nd Ability (2 Kills | 22s Cooldown | `RIGHT CLICK`):** *MAGMA RING* - Expanding ground ring of boiling `LAVA` and `FLAME`. Deals **12.0 damage** and degrades armor durability.
- **3rd Ability (4 Kills | 18s Cooldown | `OFFHAND+CROUCH`):** *INFERNAL ERUPTION* - Erupts violent flame geysers beneath enemy feet marked with burning `CAMPFIRE_COSY_SMOKE` columns. Deals **11.0 damage**.
10. **Glacial Sunder (Netherite Sword — CMD 8)** — Rendered in **bold text** with an icy frost gradient (`#E0FFFF` to `#1E90FF` - Light Cyan to Dodger Blue)
- **PASSIVE (0 Kills):** *FROSTBITE AURA* - Frost mist `SNOWFLAKE` particle trail; severely slows attackers on hit.
- **1st Ability (0 Kills | 16s Cooldown | `OFFHAND`):** *CRYOFREEZE* - Crystal beam of `SNOWFLAKE` and `WHITE_ASH`. Freezes target solid for 2.5s and deals **8.0 damage**.
- **2nd Ability (2 Kills | 25s Cooldown | `RIGHT CLICK`):** *ICE SHARD BARRAGE* - Launches 7 sharp ice projectiles (`ITEM_SNOWBALL`). Deals **12.0 total damage**.
- **3rd Ability (4 Kills | 20s Cooldown | `OFFHAND+CROUCH`):** *GLACIAL DOMAIN* - Freezes surrounding ground into an 8-block ice sheet, dropping target speed to zero and dealing **10.0 damage**.
*Netherite Axe (1 Variant — CMD 2)*
11. **Berserker's Dreadaxe (Netherite Axe — CMD 2)** — Rendered in **bold text** with a fierce berserker rage gradient (`#8B0000` to `#FF8C00` - Dark Red to Dark Orange)
- **PASSIVE (0 Kills):** *BLOOD LUST* - Aggressive `ANGRY_VILLAGER` and `DAMAGE_INDICATOR` wisps; grants permanent Resistance II when below 50% HP.
- **1st Ability (0 Kills | 15s Cooldown | `OFFHAND`):** *CLEAVE SLAM* - Downward slam with `CRIT` and `BLOCK_CRACK` stone fragments. Deals **10.0 shockwave damage**.
- **2nd Ability (2 Kills | 24s Cooldown | `RIGHT CLICK`):** *SHIELD SHREDDER* - Impact flash burst (`FLASH` particles). Shatters shields instantly, disables shielding for 6s, and deals **13.0 damage**.
- **3rd Ability (4 Kills | 18s Cooldown | `OFFHAND+CROUCH`):** *WAR CRY BLAST* - Emits a massive circular shockwave pattern of `CAMPFIRE_SIGNAL_SMOKE` particles outward. Deals **12.0 damage** and applies Weakness III.
#### 6. Stacked Boss Bar Cooldown Tracker
* Whenever a weapon ability is triggered, display a custom **Boss Bar** to the wielder showing the weapon name formatted in **bold text** with its matching theme gradient color, ability name, and remaining cooldown.
* Support **multiple stacked boss bars** simultaneously if multiple weapon abilities are cooling down at the same time.
Locate the weapon/item lore generation and compare it with the supplied weapon specifications.
Update the lore and formatting for all affected custom items without changing unrelated mechanics.
Verify command/GUI item creation paths use the corrected lore consistently.
Updated the mythic weapon lore for all 11 weapons.
Added legendary/standard tier labels with matching gradient colors.
Added current kills, max kills, base damage, and kill-based damage scaling.
Added passive names, requirements, and descriptions.
Added every ability’s activation key, cooldown, kill requirement, damage, and effect description.
Lore updates apply both when weapons are created and when their kill progression changes.
Modified:
src/main/java/com/soulssmp/ItemFactory.javasrc/main/java/com/soulssmp/WeaponType.java
many ability not working and not showing the particle and the lore has to be not like that in the pic but with the color of the weapon name so it will look good and the weapon ability and the cooldown and the kill required to unlock the ability
Trace the weapon ability handlers and particle effects to find why abilities are not firing.
Fix the broken ability/cooldown/unlock behavior and particle visibility.
Rebuild the weapon lore so it uses the weapon’s color and clearly separates abilities, cooldowns, and kill requirements.
Ability activation now works with the weapon in either hand, including the advertised offhand trigger, and unresolved particle names fall back to a visible cloud effect.
Next I’m replacing the current lore layout with weapon-colored ability headers, cooldowns, and kill requirements.
Fixed ability activation when the weapon is held in either hand, including offhand abilities and crouch activation.
Added a visible particle fallback so unsupported particle names no longer silently produce nothing.
Updated weapon lore:
Uses the weapon’s color gradient.
Shows current kills.
Shows passive ability and description.
Shows each active ability.
Shows cooldown and activation method.
Shows required kills and marks locked abilities.
bro this did not fixed like the heavenly beam not working and other weapons too
Fix ability execution so beams and other abilities visibly run instead of failing silently.
Make Heavenly Beam a real line-of-sight beam, repair invalid root/effect handling, and preserve kill-lock requirements.
Prevent vanilla interaction from swallowing weapon activations and add clear failure feedback for locked/cooldown abilities.
Fixed the actual ability issues:
Heavenly Death Beam now creates a visible particle beam across 14 blocks instead of spawning particles only at one distant point.
Beam targets are damaged only once per activation.
Weapon abilities now work when the weapon is in either hand.
Right-click abilities now cancel the normal block interaction so Minecraft does not consume the click.
Weapon kills now count when the weapon is held in the offhand.
Unsupported particle names now fall back to visible
END_RODparticles.Replaced the invalid
ROOTEDpotion effect with strong Slowness plus velocity locking.Locked abilities now show the exact progress, for example:
HEAVENLY DEATH BEAM is locked: 0/1 kills.
New weapons start with 0 kills, and Solaris’s Heavenly Death Beam requires 1 kill before it can activate.
now make the weapons only level up when you kill a player like the kill requirement is for player kill not any mob and any entity kill
Change weapon progression to listen only for
PlayerDeathEvent.Keep the existing PvP soul-loss logic and increment the killer’s held weapon only when the victim is a player.
Remove the generic entity-death handler so mobs and non-player entities never add weapon kills.
Weapon kills now increase only when the weapon holder kills another player.
Removed generic
EntityDeathEventprogression.Mobs and other entities no longer grant weapon kills.
Player kills work with the weapon in either the main hand or offhand.
Existing PvP soul-loss behavior remains unchanged.
package com.soulssmp;
import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Map;
import java.util.UUID;
public final class SoulsSmpPlugin extends JavaPlugin {
private ItemFactory items;
private SoulManager souls;
private CraftingManager crafting;
private CooldownManager cooldowns;
private AbilityService abilities;
private WeaponGui weaponGui;
private NamespacedKey revivalId;
@Override
public void onEnable() {
saveDefaultConfig();
items = new ItemFactory(this);
souls = new SoulManager(this, items);
crafting = new CraftingManager(this, items);
cooldowns = new CooldownManager(this);
abilities = new AbilityService(this, items, cooldowns);
weaponGui = new WeaponGui(items);
revivalId = new NamespacedKey(this, "revival_uuid");
Bukkit.getPluginManager().registerEvents(new SoulsListener(this), this);
SoulsCommand command = new SoulsCommand(this);
for (String name : new String[]{"withdraw", "weapons", "soul", "crafting", "1crafting", "level"}) {
if (getCommand(name) != null) getCommand(name).setExecutor(command);
}
Bukkit.getScheduler().runTaskTimer(this, abilities::tickPassives, 20L, 20L);
getLogger().info("Souls SMP enabled with 11 mythic weapons.");
}
@Override
public void onDisable() {
if (souls != null) souls.save();
}
public ItemFactory items() { return items; }
public SoulManager souls() { return souls; }
public CraftingManager crafting() { return crafting; }
public AbilityService abilities() { return abilities; }
public WeaponGui weaponGui() { return weaponGui; }
public WeaponType weaponType(String name) { return WeaponType.fromName(name); }
public void effect(org.bukkit.entity.LivingEntity entity, String potion, int duration, int amplifier) {
XPotion.matchXPotion(potion).map(value -> value.buildPotionEffect(duration, amplifier)).ifPresent(entity::addPotionEffect);
}
public Inventory revivalInventory() {
RevivalHolder holder = new RevivalHolder();
Inventory inventory = Bukkit.createInventory(holder, 54, "Soul Revive Beacon");
holder.inventory = inventory;
ItemStack filler = new ItemStack(material("GRAY_STAINED_GLASS_PANE"));
ItemMeta fillerMeta = filler.getItemMeta();
fillerMeta.displayName(TextUtil.message(" "));
filler.setItemMeta(fillerMeta);
for (int i = 0; i < 54; i++) inventory.setItem(i, filler.clone());
int slot = 10;
for (Map.Entry<UUID, String> entry : souls.bannedPlayers().entrySet()) {
ItemStack skull = new ItemStack(material("SKELETON_SKULL"));
ItemMeta meta = skull.getItemMeta();
meta.displayName(Component.text(entry.getValue()));
meta.getPersistentDataContainer().set(revivalId, PersistentDataType.STRING, entry.getKey().toString());
skull.setItemMeta(meta);
inventory.setItem(slot, skull);
slot++;
if (slot % 9 == 8) slot += 2;
if (slot >= 44) break;
}
return inventory;
}
public String revivalId(ItemStack stack) {
if (stack == null || !stack.hasItemMeta()) return null;
return stack.getItemMeta().getPersistentDataContainer().get(revivalId, PersistentDataType.STRING);
}
private Material material(String name) {
return XMaterial.matchXMaterial(name).map(XMaterial::parseMaterial).orElse(Material.matchMaterial("AIR"));
}
public static final class RevivalHolder implements InventoryHolder {
private Inventory inventory;
@Override public Inventory getInventory() { return inventory; }
}
}