📄
pasted-code-1790646095668.txt
txt
1941 lines
▶
Create a **complete, production-ready Minecraft Java 1.21.11 Paper plugin using Java 21**.
This is a replacement/fix of an existing broken implementation. The previous implementation had multiple mechanics that appeared in the code but did not actually work in-game.
**DO NOT repeat those mistakes.**
The plugin must be fully functional in-game. Do not create placeholder methods, fake abilities, TODO sections, commented-out mechanics, or configuration values that are not connected to working code.
Before considering the plugin complete, every item ability, life mechanic, cooldown, PDC value, command, ritual, projectile, and event must actually work on a real Paper 1.21.11 server.
# CRITICAL FIXES FROM THE PREVIOUS VERSION
The following issues MUST be fixed:
1. Players have **2 lives**, NOT 1.
2. Executioner must NOT simply increase damage by half a heart.
3. Executioner right-click must activate **FURY**.
4. Fury must allow the Executioner wielder to **auto-critical-hit for 10 seconds**.
5. SkyBreaker Density must NOT be directly upgradeable through a command or arbitrary interaction.
6. SkyBreaker Density can ONLY increase through the actual **8 Thunderbolt + SkyBreaker ritual**.
7. SkyBreaker lightning MUST deal real damage.
8. Every right-click ability must actually activate when used with the correct item.
9. Crouch + right-click abilities must actually detect crouching.
10. Featherfall double-jump must actually trigger.
11. Ravanger must actually detect its special shot and deal its damage.
12. Inventory Box must actually open/interact with the target inventory.
13. All cooldowns must actually prevent ability reuse.
14. Custom items must be identified through PDC, not names.
15. Renaming a custom item must NOT break its ability.
16. Do not silently remove or simplify any mechanic requested below.
---
# 1. TWO-LIFE SYSTEM
Every player starts with exactly:
**2 lives**
Never initialize new players with 1 life.
Lives must persist through:
* Server restarts
* Relogging
* World changes
* Death
* Respawn
Normal Minecraft health must remain unchanged.
Do NOT modify max health.
## New player
When a player has never been stored before:
```text
lives = 2
```
Save immediately.
## First death
If the player has:
```text
2 lives
```
and dies:
```text
2 → 1
```
Broadcast in red:
```text
has lost a life.
```
After respawn:
Display:
```text
Juju ❤️
```
TAB:
```text
❤️ Juju
```
## Final death
If the player has:
```text
1 life
```
and dies:
```text
1 → 0
```
Broadcast:
```text
has been eliminated.
```
Set the player to:
```text
GameMode.SPECTATOR
```
Also broadcast in yellow:
```text
has left the game.
```
Display:
```text
Juju 💀
```
TAB:
```text
💀 Juju
```
An eliminated player MUST NOT automatically receive lives again.
Joining, quitting, respawning, or restarting the server must never reset an eliminated player back to 2 lives.
Only an admin command can change their lives.
## Life commands
Implement:
```text
/lives set
/lives add
/lives remove
/lives reset
/lives get
```
Permission:
```text
scriptedsmp.admin
```
`reset` means reset the player's stored lives to exactly:
```text
2
```
Do not confuse reset with elimination.
---
# 2. CUSTOM ITEM IDENTIFICATION
Every custom item MUST contain a unique PersistentDataContainer ID.
Example:
```text
scriptedsmp:item_id = skybreaker
```
Never use the display name as the actual identification mechanism.
This means:
A player can rename:
```text
SkyBreaker
```
to:
```text
Bob's Lightning Mace
```
and it must STILL work.
Likewise, changing lore must not remove functionality.
The item identity lives in PDC.
Every custom item must also store its own persistent data where needed.
Example SkyBreaker:
```text
scriptedsmp:item_id = skybreaker
scriptedsmp:density = 6
```
The Density belongs to THAT INDIVIDUAL MACE.
---
# 3. ⚡ SKYBREAKER — MACE
Material:
```text
MACE
```
Never use a fake "Netherite Mace."
## SKYBREAKER HIT
Every successful SkyBreaker melee hit against another player must:
1. Detect the custom SkyBreaker PDC.
2. Determine the attacker's current airborne combo against that target.
3. Summon lightning on the target.
4. Deal REAL configurable damage.
5. Increase lightning damage if the attacker remains airborne.
6. Keep combos separate for every attacker/target pair.
Example:
```text
Hit 1 → lightning + damage
Hit 2 → stronger lightning + damage
Hit 3 → even stronger lightning + damage
```
The lightning MUST NOT only be visual.
It MUST cause actual health damage.
Example configurable settings:
```yaml
skybreaker:
lightning:
base_damage: 4.0
combo_damage_increase: 2.0
max_damage: 20.0
```
Minecraft damage is in HP.
Therefore:
```text
4.0 HP = 2 hearts
20.0 HP = 10 hearts
```
Do not accidentally treat hearts as HP.
## IMPORTANT LIGHTNING IMPLEMENTATION
Do NOT rely on:
```java
world.strikeLightning(...)
```
alone and assume that it will provide the desired configurable damage.
The plugin must explicitly apply the configured damage to the target.
Lightning can be visual, but the plugin must separately ensure:
```text
target.damage(actualConfiguredDamage, attacker)
```
or an equivalent correct Paper 1.21.11 damage mechanism.
The SkyBreaker wielder MUST be immune to the lightning damage caused by their own SkyBreaker.
Do not damage nearby random players unless configured.
## AIRBORNE COMBO
The lightning combo increases ONLY while the attacker remains airborne.
If:
```text
player.isOnGround()
```
becomes true:
```text
airborne combo = 0
```
Reset the appropriate attacker/target combo.
Do not transfer combos between players.
---
# 4. ⚡ SKYBREAKER DENSITY
Every newly created SkyBreaker starts with:
```text
Density = 6
```
Density is stored directly on the item PDC.
Example:
```text
scriptedsmp:density = 6
```
If the mace is:
* dropped
* picked up
* moved between inventories
* put in a chest
* traded
* transferred
* logged out
* logged back in
the Density MUST remain attached to the item.
Do NOT store the Density only by player UUID.
The Density belongs to the mace.
---
# 5. SKYBREAKER DENSITY MUST ONLY BE UPGRADED THROUGH THE RITUAL
THIS IS CRITICAL.
There must NOT be:
```text
/skybreaker upgrade
```
There must NOT be:
```text
right click = upgrade
```
There must NOT be:
```text
shift right click = upgrade
```
There must NOT be an admin shortcut unless specifically requested.
The ONLY normal way to increase Density is:
```text
8 Thunderbolts
+
1 SkyBreaker
=
1 SkyBreaker with Density +1
```
---
# 6. ⚡ THUNDERBOLT
When a player dies, create/drop one special:
```text
PRISMARINE_SHARD
```
with the custom name:
```text
Thunderbolt
```
and a unique PDC ID:
```text
scriptedsmp:item_id = thunderbolt
```
A normal Prismarine Shard renamed to "Thunderbolt" MUST NOT work.
Only the PDC Thunderbolt works.
---
# 7. SKYBREAKER RITUAL
The ritual is a real 3×3 crafting-style pattern:
```text
Thunderbolt | Thunderbolt | Thunderbolt
Thunderbolt | SkyBreaker | Thunderbolt
Thunderbolt | Thunderbolt | Thunderbolt
```
The center item MUST be the actual custom SkyBreaker.
The surrounding eight items MUST be actual PDC Thunderbolts.
Normal Prismarine Shards do not count.
The ritual should be implemented as a controlled custom crafting/ritual interaction.
It must NOT simply be possible to place 8 random renamed shards around a mace and receive an upgrade.
## WHEN THE RITUAL COMPLETES
Perform ALL of these steps:
### STEP 1
Read the SkyBreaker's current Density.
Example:
```text
Density 6
```
### STEP 2
Calculate:
```text
newDensity = oldDensity + 1
```
Example:
```text
6 → 7
```
### STEP 3
Consume:
* 8 Thunderbolts
* 1 SkyBreaker
### STEP 4
Prevent the normal crafting system from producing a vanilla output.
The ritual is custom.
### STEP 5
Create a huge ritual effect.
It must include:
* Explosion
* Lightning
* Particles
* Sounds
* Screen-shaking-style visual effects where possible
* Large crater
* Dramatic center effect
### STEP 6 — TOTEMS
Every player within the configured ritual radius must be checked.
If they have a Totem of Undying available, the ritual should cause the Totem to activate/pop as requested.
Do this safely using the correct Paper event/damage mechanics rather than directly killing players.
Do not consume Totems from players who do not actually have an available Totem.
### STEP 7 — PHYSICAL CRATER
Create a real physical crater.
The crater must modify blocks.
The crater size, depth, shape, material behavior, and radius must be configurable.
Do not merely spawn explosion particles and call it a crater.
### STEP 8 — SAVE ORIGINAL BLOCKS
Any blocks intentionally destroyed/modified for the ritual must be tracked if restoration is enabled.
Do not leave corrupted temporary blocks behind.
### STEP 9 — SKYBREAKER PLACEMENT
After the explosion and crater are completed:
Create the upgraded SkyBreaker:
```text
Density = oldDensity + 1
```
Place/drop it at the EXACT center of the ritual.
The upgraded SkyBreaker must be created AFTER the explosion so the explosion cannot destroy the newly upgraded mace.
The upgraded mace must have:
```text
scriptedsmp:item_id = skybreaker
scriptedsmp:density = newDensity
```
### STEP 10
Update its lore:
```text
⚡ SkyBreaker
Density: 7
⚡ Lightning Combo
💨 Thunder Dash
```
If it upgrades again:
```text
Density: 8
```
etc.
---
# 8. SKYBREAKER DENSITY SCALING
Each Density increases:
* Lightning damage
* Dash speed
* Dash distance
Example configurable formula:
```text
lightningDamage =
baseLightningDamage
+
((density - 6) × lightningDamagePerDensity)
dashSpeed =
baseDashSpeed
+
((density - 6) × dashSpeedPerDensity)
dashDistance =
baseDashDistance
+
((density - 6) × dashDistancePerDensity)
```
Allow a configurable maximum Density.
If:
```yaml
max_density: -1
```
then there is no maximum.
Do NOT silently cap Density at 7, 10, 100, etc.
---
# 9. ⚡ SKYBREAKER THUNDER DASH
Right-click SkyBreaker.
This MUST actually work.
When the player right-clicks while holding the custom SkyBreaker:
* Detect the PDC.
* Check cooldown.
* Read Density.
* Calculate dash strength.
* Launch the player in their look direction.
* Apply configured velocity.
* Consume/start cooldown.
* Play configured sound.
* Spawn configured particles.
The player must actually move.
Do NOT merely play particles.
Do NOT require crouching unless configured.
Right-click means:
```text
PlayerInteractEvent
RIGHT_CLICK_AIR
RIGHT_CLICK_BLOCK
```
Both must be handled safely.
---
# 10. ⚔️ EXECUTIONER — NETHERITE SWORD
Material:
```text
NETHERITE_SWORD
```
The Executioner has TWO distinct mechanics:
1. Increasing combo damage.
2. Fury activated by right-click.
## COMBO DAMAGE
Every consecutive hit against the SAME target increases damage.
Example:
```text
Hit 1 → normal
Hit 2 → stronger
Hit 3 → stronger
Hit 4 → stronger
```
However, the damage increase must be meaningful.
Do NOT implement:
```text
+0.5 hearts
```
as the only effect.
Use configurable values.
Example:
```yaml
executioner:
combo:
starting_damage: 8.0
damage_per_hit: 4.0
max_bonus_damage: 20.0
max_combo: 6
```
Meaning:
```text
Hit 1 = 8 HP
Hit 2 = 12 HP
Hit 3 = 16 HP
Hit 4 = 20 HP
Hit 5 = 24 HP
Hit 6 = 28 HP
```
These values are examples only and must be configurable.
## COMBO RESET
If the target attacks the Executioner wielder:
```text
combo = 0
```
Immediately.
If the Executioner attacks a different target:
The new target gets its own combo.
Example:
```text
Juju → Bob = combo 3
Juju → Steve = combo 1
Juju → Bob = combo 4
```
Bob's combo does not transfer to Steve.
Optional timeout can reset combos after a configurable number of seconds.
---
# 11. EXECUTIONER FURY
THIS IS REQUIRED.
Right-clicking the Executioner activates:
# FURY
For the configured duration:
```text
10 seconds
```
the Executioner wielder gets automatic critical-hit behavior.
## Fury behavior
While Fury is active:
Every successful melee attack with the Executioner should be treated as a critical hit.
The plugin must actually produce the critical attack behavior/damage.
Do NOT simply spawn crit particles.
Do NOT simply rename the item.
Do NOT just give Strength.
The actual attack must deal critical-hit damage.
Use the correct Paper 1.21.11 combat/damage mechanics.
If vanilla critical damage is being manually calculated, implement the correct critical multiplier instead of guessing.
The player does NOT need to fall manually for the custom Fury critical effect.
Fury forces the weapon's attacks to behave as critical hits.
## Fury duration
Default:
```text
10 seconds
```
Configurable:
```yaml
fury:
duration: 10
```
## Fury cooldown
Give Fury its own configurable cooldown.
Example:
```yaml
fury:
cooldown: 30
```
## Fury activation
Only:
```text
Right-click Executioner
```
activates Fury.
Do not require crouching.
Do not activate Fury on left-click.
## Fury visual feedback
While Fury is active:
* Display Fury status in Action Bar.
* Spawn configurable particles.
* Play activation sound.
* Optionally give a subtle visual effect.
Example:
```text
⚔ FURY — 10s
```
When it ends:
```text
⚔ FURY ENDED
```
Do not add unrelated abilities.
---
# 12. 🪓 HARPOON
Material:
```text
NETHERITE_AXE
```
## Sword-speed behavior
The Harpoon must behave like a sword for attack cooldown.
Implement the correct attack-speed attribute for the item.
It must actually attack faster than a normal axe.
Do NOT merely change lore saying "Sword Speed."
The attribute must actually be applied.
## Hook
ONLY:
```text
Crouching + Right-click
```
activates the hook.
Normal right-click:
```text
nothing
```
unless another explicitly requested interaction applies.
When activated:
1. Find a valid player target in the configured range and line of sight.
2. Fire a visible hook/chain particle path.
3. Animate the hook traveling toward the target.
4. When it connects:
* pull target toward wielder
* play sound
* show particles
5. Stop the particle effect after completion.
6. Start cooldown.
The pull must physically move the target.
Do not merely display particles.
If no target exists:
```text
miss
```
and safely end the ability.
---
# 13. 🪽 FEATHERFALL
Material:
```text
ELYTRA
```
Featherfall's ability is a DOUBLE JUMP.
The plugin must actually detect a double-jump.
Recommended behavior:
1. Player jumps.
2. While airborne, a second jump input is detected.
3. If Featherfall is equipped/held according to the configured requirement:
* check cooldown
* launch player forward
* use look direction
* enable Elytra glide
* spawn wind/cloud particles
* play sound
* start cooldown
The boost must physically launch the player.
Do not merely add particles.
Do not turn Featherfall into a Meteor.
Do not add a slam.
Core mechanic:
```text
DOUBLE JUMP → BOOST → GLIDE
```
---
# 14. 🏹 RAVANGER
Material:
```text
CROSSBOW
```
Ravanger must have an actual working special shot.
A direct successful hit against a player:
```text
40 HP damage
```
which equals:
```text
20 hearts
```
Default configurable value:
```yaml
damage: 40.0
```
## Armor damage
The shot must ALSO damage the target's equipped armor durability.
This is separate from health damage.
Example:
```text
armor_durability_damage: 230
```
Apply the configured durability loss safely to armor pieces.
Do not accidentally apply 230 HP damage.
Do not use the armor durability value as health damage.
## Projectile detection
The plugin must reliably identify the Ravanger's projectile as a Ravanger projectile using PDC or another persistent projectile marker.
Do not assume every crossbow arrow is a Ravanger shot.
Normal crossbows must remain normal.
## Particle trail
While the Ravanger projectile is flying:
* spawn configurable particles
* continue until impact/despawn
* clean up the task
Do not create infinite repeating tasks.
## Cooldown
A successful Ravanger shot starts cooldown.
Cooldown must actually prevent another Ravanger shot.
---
# 15. 📦 INVENTORY BOX
Material:
```text
CHEST
```
Right-click a player within:
```text
4 blocks
```
Open a custom GUI showing the target inventory.
The user can steal only:
```text
1 item
```
by default.
Once an item is stolen:
* Remove it from the target.
* Give it to the Inventory Box user.
* Create a persistent return record.
* Start a 4-minute timer.
* Return the exact stolen ItemStack to the original target.
The timer MUST survive:
* restart
* relog
* world change
If the target is offline:
Keep the item stored.
When the return time expires and the target is offline, safely retain the item until it can be returned.
Do NOT delete the stolen item.
Do NOT allow unlimited stealing through GUI manipulation.
Close the GUI when necessary.
Cancel illegal shift-click/drag exploits.
---
# 16. ⚓ ANCHOR
Material:
```text
SHIELD
```
Right-click:
```text
activate
```
For default:
```text
5 seconds
```
the player is immune to knockback.
This must be actual knockback prevention.
Do NOT simply give Resistance.
Do NOT just display particles.
Intercept/apply the correct velocity/knockback behavior.
---
# 17. 🫳 SNATCH
Material:
```text
NETHERITE_HOE
```
Right-click player within:
```text
5 blocks
```
Take the target's current main-hand ItemStack.
Remove it from the target.
Give it to the Snatch user.
If the inventory is full:
Safely drop the item at the Snatch user's location or another configured safe method.
Never delete the item.
---
# 18. 🎲 DICE
Material:
```text
TRIPWIRE_HOOK
```
Right-click:
Roll:
```text
1–6
```
Each outcome must actually execute.
Default:
### 1
Speed IV for 8 seconds.
### 2
Strength II for 8 seconds.
### 3
Launch player upward.
### 4
Heal 4 hearts.
### 5
Random teleport approximately 10 blocks.
The teleport MUST:
* avoid suffocating blocks where possible
* avoid unsafe destinations
* remain within configured range
### 6
Launch nearby players within approximately 5 blocks.
Every outcome must be configurable.
---
# 19. 🧱 WALL
Material:
```text
NETHERITE_SHOVEL
```
Right-click ground.
Create a physical temporary wall.
Default:
```text
3×3
```
in front of the player.
Save every replaced block.
After duration:
Restore the ORIGINAL blocks.
If another player changes a temporary wall block during the duration, handle restoration safely according to configuration.
Never permanently destroy terrain.
Do not replace blocks without recording what was there first.
---
# 20. 💰 PICKPOCKET
Material:
```text
GOLD_NUGGET
```
Right-click player.
Choose a random item from their hotbar.
Default:
```text
1 item
```
Transfer it.
Never delete the item if inventory is full.
Configurable range/cooldown/count.
---
# 21. 🌑 BLACKOUT
Material:
```text
SOUL_LANTERN
```
Right-click.
Find nearby players inside configured radius.
Apply:
```text
BLINDNESS
```
for configured duration.
By default, the user is excluded.
Allow config to include the user if desired.
Actually apply the effect.
Do not only spawn darkness particles.
---
# 22. 🪙 COIN FLIP
Material:
```text
GOLD_NUGGET
```
Right-click.
Generate a real random 50/50 result.
Display:
```text
HEADS
```
or:
```text
TAILS
```
Use configurable outcomes.
Do not create fake randomness based on time.
---
# 23. UNIVERSAL COOLDOWN SYSTEM
Implement one centralized:
```text
CooldownManager
```
Cooldowns are stored by:
```text
UUID + ability/item ID
```
Example:
```text
UUID + skybreaker_dash
UUID + executioner_fury
UUID + harpoon
UUID + featherfall
```
Switching items must not reset cooldown.
Dropping/re-picking an item must not reset cooldown.
Relogging must not accidentally bypass cooldown.
Use server time/epoch timestamps rather than only temporary scheduled tasks where persistence is required.
Action Bar:
```text
⚡ SKYBREAKER — 5s
```
```text
⛓ HARPOON — 8s
```
```text
⚔ FURY — 6s
```
When ready:
```text
⚡ SKYBREAKER — READY
```
Do not spam multiple Action Bars from multiple systems.
Create one centralized cooldown display manager.
---
# 24. RIGHT-CLICK EVENT REQUIREMENTS
This is important because the previous implementation had abilities that did not activate.
All right-click items must use a reliable centralized interaction listener.
Handle BOTH:
```text
RIGHT_CLICK_AIR
RIGHT_CLICK_BLOCK
```
For every custom item.
The listener must:
1. Get ItemStack from the correct hand.
2. Check PDC.
3. Determine custom item ID.
4. Check whether the item is enabled.
5. Check cooldown.
6. Execute the ability.
7. Cancel vanilla behavior only when appropriate.
8. Start cooldown only when the ability successfully activates.
Do NOT depend on display names.
Do NOT use one event class per item if that creates conflicting handlers.
Prevent duplicate activation from off-hand/main-hand events.
---
# 25. ITEM MATERIAL CONFIGURATION
Every item should support configurable material where technically safe.
However, the default materials MUST be:
```text
SkyBreaker = MACE
Executioner = NETHERITE_SWORD
Harpoon = NETHERITE_AXE
Featherfall = ELYTRA
Ravanger = CROSSBOW
Inventory Box = CHEST
Anchor = SHIELD
Snatch = NETHERITE_HOE
Dice = TRIPWIRE_HOOK
Wall = NETHERITE_SHOVEL
Pickpocket = GOLD_NUGGET
Blackout = SOUL_LANTERN
Coin Flip = GOLD_NUGGET
Thunderbolt = PRISMARINE_SHARD
```
---
# 26. COMMANDS
Implement:
```text
/smpitem give -
```
Aliases:
```text
skybreaker
executioner
harpoon
featherfall
ravanger
inventorybox
anchor
snatch
dice
wall
pickpocket
blackout
coinflip
```
Also:
```text
/scriptedsmp reload
```
and:
```text
/lives set
/lives add
/lives remove
/lives reset
/lives get
```
Permissions:
```text
scriptedsmp.admin
scriptedsmp.item.give
```
Provide useful command errors and tab completion.
---
# 27. CONFIGURATION
Everything that is actually configurable must be connected to code.
Do NOT create fake config values.
Example:
```yaml
items:
skybreaker:
enabled: true
material: MACE
name: "&b⚡ SkyBreaker"
density:
starting: 6
max: -1
lightning_damage: 4.0
lightning_damage_per_density: 1.0
dash_speed: 2.5
dash_speed_per_density: 0.15
dash_distance: 8.0
dash_distance_per_density: 1.0
dash:
cooldown: 8.0
ritual:
radius: 10.0
explosion_power: 12.0
crater_radius: 12
crater_depth: 6
restore_crater: false
lightning_count: 20
sound: ENTITY_LIGHTNING_BOLT_THUNDER
executioner:
enabled: true
material: NETHERITE_SWORD
name: "&c⚔ Executioner"
combo:
starting_damage: 8.0
damage_per_hit: 4.0
max_combo: 6
max_bonus_damage: 20.0
timeout: 8.0
fury:
duration: 10.0
cooldown: 30.0
harpoon:
enabled: true
material: NETHERITE_AXE
name: "&6⛓ Harpoon"
hook:
range: 20.0
pull_strength: 2.0
cooldown: 10.0
featherfall:
enabled: true
material: ELYTRA
name: "&f🪽 Featherfall"
boost:
strength: 2.5
cooldown: 8.0
ravanger:
enabled: true
material: CROSSBOW
name: "&4🏹 Ravanger"
shot:
damage: 40.0
armor_durability_damage: 230
cooldown: 30.0
```
Continue appropriate sections for every item.
Do not include settings that have no implementation.
---
# 28. PERSISTENCE
Use a reliable persistent storage system.
At minimum persist:
```text
Player UUID
Lives
```
For SkyBreaker:
The Density must be on the item PDC.
For Inventory Box:
Persist:
```text
original player UUID
stolen ItemStack
return timestamp
```
Do not store important information only in static Java Maps.
Static maps may be used as runtime caches, but persistent data must exist on disk.
---
# 29. PROJECT STRUCTURE
Use a clean modular architecture.
Example:
```text
src/main/java/
└── your/package/
├── ScriptedSMP.java
│
├── commands/
│ ├── SMPItemCommand.java
│ ├── LivesCommand.java
│ └── ReloadCommand.java
│
├── items/
│ ├── CustomItemManager.java
│ ├── SkyBreaker.java
│ ├── Executioner.java
│ ├── Harpoon.java
│ ├── Featherfall.java
│ ├── Ravanger.java
│ ├── InventoryBox.java
│ ├── Anchor.java
│ ├── Snatch.java
│ ├── Dice.java
│ ├── Wall.java
│ ├── Pickpocket.java
│ ├── Blackout.java
│ └── CoinFlip.java
│
├── listeners/
│ ├── CombatListener.java
│ ├── InteractionListener.java
│ ├── DeathListener.java
│ ├── MovementListener.java
│ ├── ProjectileListener.java
│ ├── InventoryListener.java
│ └── PlayerListener.java
│
├── cooldowns/
│ └── CooldownManager.java
│
├── lives/
│ └── LifeManager.java
│
├── storage/
│ └── DataManager.java
│
└── utils/
├── ItemUtils.java
├── ParticleUtils.java
└── DamageUtils.java
```
You may improve this architecture if necessary.
---
# 30. PAPER 1.21.11 / JAVA 21
Target exactly:
```text
Paper 1.21.11
Java 21
```
Use APIs appropriate for this version.
Do not use outdated pre-1.20 APIs.
Do not use:
```text
Material.NETHERITE_MACE
```
because it does not exist.
Use:
```text
Material.MACE
```
Do not use deprecated APIs when a modern Paper API exists.
---
# 31. EVENT SAFETY
Handle all events correctly:
* PlayerJoinEvent
* PlayerQuitEvent
* PlayerDeathEvent
* PlayerRespawnEvent
* PlayerInteractEvent
* EntityDamageByEntityEvent
* EntityDamageEvent
* ProjectileHitEvent
* ProjectileLaunchEvent
* InventoryClickEvent
* InventoryDragEvent
* InventoryCloseEvent
* PlayerMoveEvent
* PlayerToggleSneakEvent
* PlayerItemHeldEvent
* PlayerDropItemEvent
* EntityPickupItemEvent
* World changes
* Crafting events where required
Do not register the same listener multiple times.
Do not start unlimited repeating tasks.
Every repeating task must have a clear lifecycle.
Cancel tasks when they are no longer required.
---
# 32. ANTI-EXPLOIT REQUIREMENTS
Prevent:
* Renaming custom items to bypass detection.
* Duplicating stolen Inventory Box items.
* Taking multiple Inventory Box items from one GUI.
* Taking items from another player's inventory without permission.
* Re-triggering abilities from off-hand duplicate events.
* Bypassing cooldowns by dropping/re-picking items.
* Bypassing Fury cooldown by switching items.
* Creating fake Thunderbolts by renaming Prismarine Shards.
* Upgrading SkyBreaker without the ritual.
* Losing the upgraded SkyBreaker during its ritual explosion.
* Ravanger projectiles being confused with normal crossbow projectiles.
* Temporary Wall blocks permanently destroying terrain.
---
# 33. FINAL TEST CHECKLIST
Before outputting the project, internally verify every item against this list.
## Lives
```text
New player = 2
Death = 1
Death again = 0
0 = Spectator
Restart = same lives
Relog = same lives
```
## SkyBreaker
```text
MACE works
Hit creates lightning
Lightning actually damages target
Airborne combo increases damage
Ground resets combo
Wielder is immune to own lightning
Right-click actually dashes
Density starts at 6
Density stored on mace
Thunderbolt PDC works
Fake renamed shard does not work
8 Thunderbolts + SkyBreaker performs ritual
Ritual physically consumes ingredients
Density increases exactly +1
Explosion occurs
Crater occurs
Lightning occurs
Particles occur
Sounds occur
Totem behavior occurs
Upgraded mace survives explosion
Upgraded mace has new Density
```
## Executioner
```text
Sword works
Combo damage actually increases
Different targets have separate combos
Target hitting wielder resets combo
Right-click activates Fury
Fury lasts 10 seconds by default
Fury causes actual critical attacks
Fury cooldown works
```
## Harpoon
```text
Axe attack speed is sword-like
Normal right-click does nothing
Crouch + right-click activates hook
Hook travels
Hook connects
Target physically gets pulled
Cooldown works
```
## Featherfall
```text
Elytra works
Double-jump detected
Boost physically launches player
Look direction controls boost
Gliding activates
Particles work
Cooldown works
```
## Ravanger
```text
Crossbow works
Special projectile identified
Direct player hit = 40 HP by default
Armor durability actually decreases
Particle trail works
Cooldown works
```
## Inventory Box
```text
Right-click target works
GUI opens
Only allowed item count can be stolen
Item is actually removed
Item is actually returned
4-minute timer persists
Restart does not lose stolen item
```
## Anchor
```text
Right-click works
Knockback actually blocked
Duration works
Cooldown works
```
## Snatch
```text
Right-click player works
Main-hand item transfers
Full inventory does not delete item
```
## Dice
```text
Right-click rolls
1 works
2 works
3 works
4 works
5 works
6 works
```
## Wall
```text
Right-click ground works
3×3 wall appears
Original blocks saved
Original blocks restored
```
## Pickpocket
```text
Right-click target works
Random hotbar item selected
Item transfers
```
## Blackout
```text
Right-click works
Nearby players get Blindness
User excluded by default
```
## Coin Flip
```text
Right-click works
Heads/Tails random result
Result displayed
```
---
# 34. OUTPUT REQUIREMENT
Output the COMPLETE project.
Include:
1. Complete Java source code.
2. Every required class.
3. `plugin.yml`.
4. `config.yml`.
5. Persistent storage/data system.
6. All commands.
7. All listeners.
8. All custom item classes.
9. Universal cooldown system.
10. Complete 2-life system.
11. Complete SkyBreaker Density system.
12. Complete Thunderbolt ritual.
13. Physical crater.
14. Totem behavior.
15. Executioner Fury.
16. Actual critical-hit implementation.
17. Working Harpoon hook.
18. Working Featherfall double-jump.
19. Working Ravanger projectile.
20. Working Inventory Box GUI.
21. Installation instructions.
22. Build instructions.
23. Exact folder/package structure.
**DO NOT OUTPUT PSEUDOCODE.**
**DO NOT OUTPUT PLACEHOLDERS.**
**DO NOT SAY "IMPLEMENT THIS LATER."**
**DO NOT CREATE METHODS THAT ONLY RETURN TRUE/NULL WITHOUT IMPLEMENTING THE MECHANIC.**
**DO NOT CLAIM AN ABILITY WORKS IF THE CODE ONLY SHOWS PARTICLES/SOUNDS.**
Every requested ability must produce its actual gameplay effect.
The most important requirement is:
# IF I RIGHT-CLICK THE CORRECT CUSTOM ITEM, THE ABILITY MUST ACTUALLY HAPPEN IN-GAME.
The final plugin should feel like a polished creator-SMP plugin: simple, powerful, recognizable, and reliable.
Create the Java 21/Paper project, configuration, persistent storage, custom-item factory, and plugin wiring.
Implement lives, abilities, crafting ritual, inventory returns, cooldown display, and commands.
Implemented the ScriptedSMP Paper 1.21.11 / Java 21 project, including custom-item PDC identity, persistent lives and cooldowns, the SkyBreaker ritual, all listed abilities, and the admin commands.
Project layout
settings.gradle
build.gradle
src/main/resources/
├── plugin.yml
└── config.yml
src/main/java/com/kodari/scriptedsmp/
├── ScriptedSMP.java
├── command/
│ ├── LivesCommand.java
│ ├── SMPCommand.java
│ └── SMPItemCommand.java
├── cooldown/CooldownManager.java
├── item/CustomItemManager.java
├── listener/
│ ├── LifeListener.java
│ └── SMPListener.java
└── storage/DataStore.java
Build from the project root with Java 21 and Gradle: gradle build. Install build/libs/ScriptedSMP-1.0.0.jar in the server’s plugins folder, then restart Paper. Configure abilities in plugins/ScriptedSMP/config.yml; persistent data is stored in plugins/ScriptedSMP/data.yml.
The skybreaker is supposed to work as a mace
Let vanilla melee damage resolve so Skybreaker retains the mace’s slam damage and hit behavior.
Add the configured lightning damage as a bonus instead of replacing/canceling the mace hit.
Skybreaker now lets vanilla mace hits resolve, preserving slam damage and mace behavior. Its configured lightning damage is added as a bonus instead of replacing the hit.
make it so when u use the featherfall double jump it only playes the sound for 2 seconds also when ur flying and you crouch and right click it launches your insanly quick where you looking
Limit Featherfall double-jump sound to two seconds.
Add a crouch + right-click launch while flying, aimed in the player’s look direction.
Featherfall’s double-jump sound now stops after 2 seconds. While gliding, crouch and right-click to launch in the direction you’re looking at high speed.
package com.kodari.scriptedsmp;
import com.kodari.scriptedsmp.command.LivesCommand;
import com.kodari.scriptedsmp.command.SMPCommand;
import com.kodari.scriptedsmp.command.SMPItemCommand;
import com.kodari.scriptedsmp.cooldown.CooldownManager;
import com.kodari.scriptedsmp.item.CustomItemManager;
import com.kodari.scriptedsmp.listener.LifeListener;
import com.kodari.scriptedsmp.listener.SMPListener;
import com.kodari.scriptedsmp.storage.DataStore;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;
public final class ScriptedSMP extends JavaPlugin {
private NamespacedKey itemIdKey;
private NamespacedKey densityKey;
private NamespacedKey projectileKey;
private NamespacedKey stolenKey;
private DataStore dataStore;
private CooldownManager cooldowns;
private CustomItemManager items;
private LifeListener lifeListener;
private SMPListener smpListener;
@Override
public void onEnable() {
saveDefaultConfig();
itemIdKey = new NamespacedKey(this, "item_id");
densityKey = new NamespacedKey(this, "density");
projectileKey = new NamespacedKey(this, "ravanger_projectile");
stolenKey = new NamespacedKey(this, "borrowed_item");
dataStore = new DataStore(this);
cooldowns = new CooldownManager(this);
items = new CustomItemManager(this);
lifeListener = new LifeListener(this);
smpListener = new SMPListener(this);
Bukkit.getPluginManager().registerEvents(lifeListener, this);
Bukkit.getPluginManager().registerEvents(smpListener, this);
registerRitualRecipe();
SMPItemCommand itemCommand = new SMPItemCommand(this);
getCommand("smpitem").setExecutor(itemCommand);
getCommand("smpitem").setTabCompleter(itemCommand);
SMPCommand smpCommand = new SMPCommand(this);
getCommand("scriptedsmp").setExecutor(smpCommand);
getCommand("scriptedsmp").setTabCompleter(smpCommand);
getCommand("lives").setExecutor(new LivesCommand(this));
getCommand("lives").setTabCompleter(new LivesCommand(this));
Bukkit.getScheduler().runTaskTimer(this, () -> {
smpListener.tick();
dataStore.restoreDueBlocks();
}, 20L, 20L);
}
@Override
public void onDisable() {
if (dataStore != null) dataStore.save();
}
public void reloadPluginConfig() {
reloadConfig();
registerRitualRecipe();
}
public void registerRitualRecipe() {
NamespacedKey key = new NamespacedKey(this, "skybreaker_ritual");
Bukkit.removeRecipe(key);
var mace = items == null ? null : items.material("skybreaker");
var shard = items == null ? null : items.material("thunderbolt");
if (mace == null || shard == null) return;
org.bukkit.inventory.ItemStack result = items.createSkybreaker(getConfig().getInt("items.skybreaker.density.starting", 6));
org.bukkit.inventory.ShapedRecipe recipe = new org.bukkit.inventory.ShapedRecipe(key, result);
recipe.shape("TTT", "TMT", "TTT");
recipe.setIngredient('T', shard);
recipe.setIngredient('M', mace);
Bukkit.addRecipe(recipe);
}
public NamespacedKey itemIdKey() { return itemIdKey; }
public NamespacedKey densityKey() { return densityKey; }
public NamespacedKey projectileKey() { return projectileKey; }
public NamespacedKey stolenKey() { return stolenKey; }
public DataStore dataStore() { return dataStore; }
public CooldownManager cooldowns() { return cooldowns; }
public CustomItemManager items() { return items; }
public LifeListener lifeListener() { return lifeListener; }
}