ashwinbijarania0-glitch
📎 1 file 14,944 chars
📄
pasted-code-1795264099204.txt
txt 550 lines
▶
HEARTBOUND SMP 2.0 – ADVANCED LIFESTEAL, GOLDEN HEART & REVIVAL SYSTEM

Minecraft Java Target: 26.3
Server Platform: Paper (verify exact API compatibility)
Project: Heartbound SMP 2.0

Build a complete, reliable custom Lifesteal plugin for Heartbound SMP 2.0. Follow every rule below carefully. Do not simplify, remove, or change any specified mechanic.

1. LIFE POINT SYSTEM

Life Points are the main currency of the Lifesteal system.

- Every player starts with 2 Life Points.
- 1 Life Point is equal to 1 Heart Item.
- Heart Items and Life Points are NOT two separate currencies.
- Players earn Life Points through PvP kills.
- A player receives exactly 1 Life Point for a successful eligible PvP kill.
- Life Points are used for Golden Heart progression and player revival.
- Save every player's Life Points permanently.

Example

Player A has 2 Life Points.

Player A kills Player B.

Player A receives 1 Life Point.

New total:

- Player A: 3 Life Points.

2. GOLDEN HEART SYSTEM

Golden Hearts are special upgrades that appear directly in the player's Minecraft health bar.

Important requirements:

- Golden Hearts are not physical entities.
- Do not spawn Golden Heart items in the world.
- Do not use armor stands, invisible entities, or floating objects to represent them.
- Use a suitable custom resource pack for their appearance.
- Golden Hearts must be visible in the health bar.
- Ordinary players must not be able to reveal their Golden Heart count through commands.
- Maximum Golden Hearts per player: 2.

How players earn Golden Hearts

Every time a player reaches 8 Life Points, convert 8 Life Points into 1 Golden Heart.

The plugin must:

1. Check the player's Life Point total.
2. Check whether the player has fewer than 2 Golden Hearts.
3. Consume 8 Life Points.
4. Award 1 Golden Heart.
5. Randomly select one eligible Golden Heart ability.
6. Play the Golden Heart reward animation.
7. Save the new progress.

Example 1: First Golden Heart

A player has 7 Life Points.

They kill another player and receive 1 Life Point.

Their total becomes 8.

The plugin consumes all 8 Life Points and awards:

- 1 Golden Heart.
- 1 randomly selected ability.

Their remaining Life Points become 0.

Example 2: Second Golden Heart

A player has 5 Life Points and 1 Golden Heart.

They earn 3 more Life Points.

Their total becomes 8.

The plugin consumes 8 Life Points and awards their second Golden Heart with another eligible random ability.

Their remaining Life Points become 0.

Example 3: Maximum Golden Hearts

A player already has 2 Golden Hearts.

The plugin must not award a third Golden Heart or a third ability.

Do not silently delete earned Life Points. Use a configurable overflow rule and document it clearly.

3. SEVEN GOLDEN HEART ABILITIES

Remove Guardian Heart completely.

There must be exactly seven Golden Heart abilities:

1. Thunder Heart
   
   - Effect: Speed I.
   - Theme: Lightning.
   - Visual: Electric blue and yellow heart.

2. Knight Heart
   
   - Effect: Resistance I.
   - Theme: Knight and defence.
   - Visual: Silver shield-style heart.

3. Warrior Heart
   
   - Effect: Strength I.
   - Theme: Warrior and fire.
   - Visual: Red fiery heart.

4. Soul Heart
   
   - Effect: Regeneration I.
   - Theme: Soul energy.
   - Visual: Green glowing heart.
   - Regeneration should be temporary, with its duration configurable.

5. Phantom Heart
   
   - Effect: Invisibility.
   - Theme: Phantom.
   - Visual: Purple ghost-style heart.
   - Invisibility should be temporary, with its duration configurable.

6. Phoenix Heart
   
   - Effect: Fire Resistance.
   - Theme: Phoenix.
   - Visual: Orange flame-style heart.

7. Ocean Heart
   
   - Effect: Water Breathing.
   - Theme: Ocean.
   - Visual: Blue water-style heart.

Random ability selection

When a player earns a Golden Heart, randomly select one of the seven abilities.

Each eligible ability must have an equal probability:

- Thunder: 1/7
- Knight: 1/7
- Warrior: 1/7
- Soul: 1/7
- Phantom: 1/7
- Phoenix: 1/7
- Ocean: 1/7

This is approximately 14.29% each.

No duplicate abilities

A player must never receive the same ability twice.

Example:

A player already owns Thunder Heart.

They earn another Golden Heart.

The plugin must randomly select from the other six abilities. Thunder Heart must not be selected again.

If the player already owns all seven abilities, no additional ability can be awarded.

Losing a Golden Heart

When a player loses a Golden Heart:

- Remove that Golden Heart from their health bar.
- Remove its associated ability immediately.
- Remove its associated potion effect immediately.
- Update the player's saved data.
- Do not accidentally remove effects from other Golden Hearts.

4. GOLDEN HEART HUD

Golden Hearts must appear in the health bar.

Requirements:

- Use a custom resource pack.
- Give Golden Hearts a unique golden appearance.
- Make normal hearts and Golden Hearts visually distinguishable.
- The position of Golden Hearts in the health bar should be randomized when assigned.
- Save the assigned position so it does not randomly change after reconnecting or restarting.
- Keep the HUD synchronized with the player's actual Golden Heart data.

Do not claim that ordinary Paper APIs can freely rearrange vanilla health-bar icons. Investigate a technically supported implementation for Minecraft 26.3 and clearly explain any client-side or resource-pack requirements.

5. PVP LIFE STEAL RULES

When one player successfully kills another player in eligible PvP:

- The killer receives exactly 1 Life Point.
- The killer must never steal the victim's Golden Heart.
- The killer must never directly steal the victim's ability.
- Only award one Life Point per eligible kill.
- Prevent repeated kills from creating unintended rewards through exploits.

Example 1: Normal Lifesteal

Victim:

- 5 Life Points.
- 0 Golden Hearts.

Killer:

- 2 Life Points.

After the kill:

- Killer receives 1 Life Point.
- Victim loses 1 Life Point.

New totals:

- Killer: 3 Life Points.
- Victim: 4 Life Points.

Example 2: Victim Has a Golden Heart

Victim:

- 3 Life Points.
- 1 Golden Heart.

Killer:

- 2 Life Points.

The killer receives exactly 1 Life Point.

The killer does not receive the victim's Golden Heart or ability.

The victim's Golden Heart loss must follow the configured Golden Heart death rules. Never transfer it to the killer.

Example 3: Victim Has No Life Points but Has Golden Hearts

Victim:

- 0 Life Points.
- 2 Golden Hearts.

After a qualifying death, remove only 1 Golden Heart from the victim.

The killer receives exactly 1 Life Point.

The victim must retain their other Golden Heart and its ability.

Implement the exact conversion and death rules consistently. Do not award additional Life Points or Golden Hearts as a side effect of losing a Golden Heart.

6. ELIMINATION SYSTEM

A player is eliminated only when BOTH conditions are true:

- Life Points = 0.
- Golden Hearts = 0.

Having zero Life Points alone does not eliminate a player if they still have a Golden Heart.

Example 1

Player:

- 0 Life Points.
- 1 Golden Heart.

Result: Player is NOT eliminated.

Example 2

Player:

- 1 Life Point.
- 0 Golden Hearts.

Result: Player is NOT eliminated.

Example 3

Player:

- 0 Life Points.
- 0 Golden Hearts.

Result: Player is eliminated.

When eliminated:

- Prevent normal participation in the server's Lifesteal gameplay.
- Mark the player as eliminated in saved data.
- Display a clear elimination message.
- Allow the Revival System to bring them back.
- Do not permanently delete their player data.

7. PLAYER REVIVAL SYSTEM

This is a major feature.

Ordinary players must be able to revive eliminated players. Revival must not be restricted to server admins.

Revival cost

The reviver must provide exactly:

1 Heart Item = 1 Life Point.

There is no separate revival currency.

Revival process

1. An eliminated player is selected as the revival target.
2. An ordinary player approaches the Revival Beacon.
3. The player interacts with the beacon.
4. The plugin checks whether the target is eliminated.
5. The plugin checks whether the reviver has at least 1 Heart Item.
6. Show a confirmation message displaying the target and the cost.
7. After successful confirmation, consume exactly 1 Heart Item.
8. Revive the eliminated player.
9. Set the revived player's Life Points to exactly 1.
10. Set their Golden Hearts to 0.
11. Remove all their previous Golden Heart abilities.
12. Restore normal gameplay access.
13. Notify both players.

The reviver loses exactly 1 Life Point. The revived player receives exactly 1 Life Point.

Example 1: Successful Revival

Player A is eliminated.

Player B has 5 Life Points.

Player B uses the Revival Beacon to revive Player A.

After successful revival:

Player B:

- Before: 5 Life Points.
- Cost: 1 Life Point.
- After: 4 Life Points.

Player A:

- Before: Eliminated.
- After: 1 Life Point.
- Golden Hearts: 0.
- Abilities: None.

Example 2: Revived Player Earns a Golden Heart

Player A has just been revived.

Their starting total is 1 Life Point.

They earn 7 additional Life Points.

Their total becomes 8.

The plugin consumes all 8 Life Points and awards:

- 1 Golden Heart.
- 1 random eligible ability.

This means a revived player needs 7 additional Life Points to earn their first Golden Heart.

Example 3: Revival Fails

Player B has 0 Heart Items.

Player B tries to revive Player A.

Result:

- Revival fails.
- Player A remains eliminated.
- Player B loses nothing.
- No duplicate or partial revival occurs.

Revival security

- A player cannot revive themselves.
- A player cannot revive someone who is already alive.
- A player cannot revive the same target twice.
- Two players cannot revive the same target simultaneously.
- Failed revival must never consume an item.
- Prevent item duplication and transaction exploits.
- Save revival status immediately.

8. REVIVAL BEACON

Create a dedicated Revival Beacon or revival altar.

It should:

- Have a custom name and appearance.
- Allow ordinary players to interact with it.
- Open a simple revival interface.
- Show eligible eliminated players.
- Display the cost of 1 Heart Item.
- Require confirmation before consuming the item.
- Show a clear success or failure message.

Protect the beacon from being destroyed or abused by ordinary players.

9. GOLDEN HEART REWARD ANIMATION

When a player receives a Golden Heart, play a special cinematic reward animation.

It must not look like a normal chest-opening animation.

Suggested sequence:

1. Darken the screen if technically supported.
2. Display a glowing golden heart in the center.
3. Show the seven ability symbols around the heart.
4. Animate energy and particles.
5. Add lightning or other suitable visual effects.
6. Perform a random selection animation.
7. Reveal the selected Golden Heart.
8. Display the ability's name and effect.
9. Update the health bar.

The animation must not interfere with normal gameplay permanently.

Verify what is technically possible with Paper 26.3 and resource packs. If a full-screen animation requires client-side support, explain the requirement.

10. COMMANDS

Create suitable commands, including:

Player commands:

- "/heart info" – Show the player's own Life Point information and available public information.
- "/heart revive " – Start the revival process if the player is eligible and the reviver has the required Heart Item.

Admin commands:

- "/heart admin revive " – Administrative revival.
- "/heart admin setpoints  " – Set Life Points.
- "/heart admin addpoints  " – Add Life Points.
- "/heart admin removehearts  " – Remove Golden Hearts.
- "/heart admin reset " – Reset the player's Lifesteal progress.
- "/heart admin reload" – Reload configuration.

Use permissions to protect administrative commands.

Do not expose hidden Golden Heart information to ordinary players through commands.

11. DATA STORAGE

Use reliable persistent storage such as SQLite.

Save:

- UUID.
- Life Points.
- Golden Heart count.
- Golden Heart abilities.
- Golden Heart HUD positions.
- Elimination status.
- Revival history.
- Ability effect state.

Requirements:

- Data must survive server restarts.
- Data must survive player disconnects.
- Prevent duplicate rewards.
- Avoid saving incomplete transactions.
- Handle unexpected server shutdowns safely.

12. CONFIGURATION

Provide a well-organized "config.yml" allowing administrators to configure:

- Starting Life Points.
- Life Points required for a Golden Heart.
- Maximum Golden Hearts.
- Revival cost.
- Revived player's starting Life Points.
- Ability effects and durations.
- Ability selection settings.
- Animation settings.
- Messages.
- Sound effects.
- Revival Beacon settings.
- Storage settings.

Do not allow configuration to silently contradict the core rules described in this prompt.

13. TESTING REQUIREMENTS

Test all of these scenarios before delivery:

1. New player starts with 2 Life Points.
2. A successful PvP kill grants exactly 1 Life Point.
3. 8 Life Points convert into 1 Golden Heart.
4. A Golden Heart grants one random ability.
5. Only the seven specified abilities can be selected.
6. Each eligible ability has equal selection probability.
7. Duplicate abilities are prevented.
8. Maximum Golden Heart count is 2.
9. Losing a Golden Heart removes its ability.
10. A player with 0 Life Points and 1 Golden Heart is not eliminated.
11. A player with 0 Life Points and 0 Golden Hearts is eliminated.
12. An ordinary player can revive an eliminated player.
13. Revival costs exactly 1 Heart Item.
14. A revived player starts with exactly 1 Life Point.
15. A revived player starts with 0 Golden Hearts and no previous abilities.
16. A revived player receives their first Golden Heart upon reaching 8 Life Points.
17. Failed revival does not consume the reviver's Heart Item.
18. Two players cannot revive the same target simultaneously.
19. Server restart does not erase player progress.
20. No third Golden Heart can be awarded.
21. No Guardian Heart exists anywhere in the plugin, configuration, messages, textures, or reward animation.

14. FINAL DELIVERY

Deliver:

- Complete Java source code.
- Working compiled plugin JAR.
- Maven project.
- "plugin.yml".
- "config.yml".
- SQLite data implementation.
- Resource pack assets for Golden Heart HUD and ability icons.
- Installation instructions.
- Configuration instructions.
- Testing report.

Before delivering, compile the project and test it on the actual target server version.

Do not pretend a feature works if the required API or client support is unavailable. Explain technical limitations and provide a compatible implementation.

FINAL RULE: Heartbound SMP 2.0 must follow the exact Lifesteal, Golden Heart, seven-ability, elimination, and revival mechanics described above. Do not add Guardian Heart or invent extra currencies.
Kodari AI
KodariYesterday at 12:28 pm 1

Kodari can build the Paper plugin, but it cannot create the resource pack required for your specified Golden Heart HUD and ability icons.

ashwinbijarania0-glitch

HEARTBOUND SMP 2.0 – COMPLETE ADVANCED LIFESTEAL PLUGIN

PROJECT INFORMATION

  • Project: Heartbound SMP 2.0
  • Minecraft: Java Edition 26.3
  • Server Software: Paper
  • Language: Java
  • Build System: Maven
  • Storage: SQLite
  • Plugin Type: Custom Advanced Lifesteal Plugin

Build a complete, stable, optimized Minecraft Lifesteal plugin specifically for Heartbound SMP 2.0.

Follow every requirement carefully. Do not remove, simplify, or change the specified gameplay mechanics.

---

  1. LIFE POINT SYSTEM

Life Points are the main currency of Heartbound SMP.

Rules:

  • Every new player starts with 2 Life Points.
  • 1 Life Point = 1 Heart Item.
  • A Heart Item and a Life Point represent the same currency.
  • Do not create two separate currencies.
  • Players earn Life Points through eligible PvP kills.
  • A successful PvP kill awards exactly 1 Life Point to the killer.
  • Life Points are required for Golden Heart progression and revival.
  • Save all player progress permanently.

Example

Player A has 2 Life Points.

Player A kills Player B.

Player A receives 1 Life Point.

New balance: 3 Life Points.

Heart Item synchronization

If Heart Items are represented by physical inventory items:

  • Each Heart Item must represent exactly 1 Life Point.
  • Prevent duplication and unauthorized creation.
  • When a Heart Item is spent for revival, subtract exactly 1 Life Point.
  • Never allow the physical item and stored Life Point balance to become inconsistent.

Do not allow players to duplicate Heart Items through inventory manipulation, dropping, reconnecting, or server restarts.

---

  1. GOLDEN HEART SYSTEM

Golden Hearts are special upgrades earned through Life Point progression.

Rules:

  • Every 8 Life Points converts into 1 Golden Heart.
  • Consume exactly 8 Life Points when awarding a Golden Heart.
  • Maximum Golden Hearts per player: 2.
  • Each Golden Heart grants one random eligible ability.
  • A player cannot receive duplicate abilities.
  • Golden Hearts are tracked internally by the plugin.
  • Golden Hearts are not physical entities.
  • Do not use armor stands, floating objects, or invisible entities to represent them.

Example 1: First Golden Heart

A player has 7 Life Points.

They kill another player and earn 1 Life Point.

Their balance becomes 8.

The plugin:

  1. Consumes 8 Life Points.
  2. Awards 1 Golden Heart.
  3. Selects a random ability.
  4. Displays a reward announcement.
  5. Saves the player's progress.

Remaining Life Points: 0.

Example 2: Second Golden Heart

A player has:

  • 5 Life Points.
  • 1 Golden Heart.

They earn 3 more Life Points.

Their balance becomes 8.

The plugin consumes 8 Life Points and awards their second Golden Heart with another eligible ability.

Remaining Life Points: 0.

Example 3: Maximum Golden Hearts

A player already owns 2 Golden Hearts.

They must not receive a third Golden Heart.

Do not silently delete additional earned Life Points. Store excess Life Points safely until the player has room for another Golden Heart, or apply a clearly documented configurable overflow rule.

---

  1. SEVEN GOLDEN HEART ABILITIES

There must be exactly seven abilities.

Guardian Heart must not exist anywhere in the plugin.

  1. Thunder Heart
  • Effect: Speed I.
  • Theme: Lightning.
  • Appearance in messages: Electric blue and yellow.
  • Reward sound: Suitable lightning-themed vanilla sound.
  1. Knight Heart
  • Effect: Resistance I.
  • Theme: Knight and defence.
  • Appearance in messages: Silver shield.
  • Reward sound: Suitable defensive sound.
  1. Warrior Heart
  • Effect: Strength I.
  • Theme: Warrior and fire.
  • Appearance in messages: Red fiery heart.
  • Reward sound: Suitable combat sound.
  1. Soul Heart
  • Effect: Regeneration I.
  • Theme: Soul energy.
  • Appearance in messages: Green glowing heart.
  • Regeneration is temporary.
  • Duration must be configurable.
  1. Phantom Heart
  • Effect: Invisibility.
  • Theme: Phantom.
  • Appearance in messages: Purple phantom heart.
  • Invisibility is temporary.
  • Duration must be configurable.
  1. Phoenix Heart
  • Effect: Fire Resistance.
  • Theme: Phoenix.
  • Appearance in messages: Orange flame heart.
  1. Ocean Heart
  • Effect: Water Breathing.
  • Theme: Ocean.
  • Appearance in messages: Blue water heart.

Random Ability Selection

When a player receives a Golden Heart, select one eligible ability randomly.

All seven abilities must have equal selection probability:

  • Thunder Heart: 1/7.
  • Knight Heart: 1/7.
  • Warrior Heart: 1/7.
  • Soul Heart: 1/7.
  • Phantom Heart: 1/7.
  • Phoenix Heart: 1/7.
  • Ocean Heart: 1/7.

This is approximately 14.29% per eligible ability.

No Duplicate Abilities

A player cannot receive the same ability twice.

Example:

A player owns:

  • Thunder Heart.
  • Knight Heart.

When they earn another Golden Heart, the plugin must select only from the five abilities they do not own.

The plugin must save all ability ownership data.

Losing an Ability

When a player loses a Golden Heart:

  • Remove the associated ability.
  • Remove its associated potion effect immediately.
  • Update their saved ability data.
  • Do not remove effects belonging to another Golden Heart.

Temporary abilities must follow their configured duration. They must not become permanent accidentally.

---

  1. GOLDEN HEART REWARD ANIMATION

When a player earns a Golden Heart, create a special reward animation using vanilla Minecraft features.

Do not use a resource pack or custom HUD.

Suggested animation:

  1. Play a special sound.
  2. Display golden particles around the player.
  3. Show a sequence of seven ability names in chat or titles.
  4. Animate the random selection through changing titles.
  5. Reveal the selected ability.
  6. Display its name and effect.
  7. Play a final reward sound.

Example reward message:

"✦ YOU HAVE RECEIVED A GOLDEN HEART! ✦"

"Your Golden Heart ability: THUNDER HEART"

"Ability: Speed I"

Use vanilla sounds, particles, titles, action bars, and chat messages.

The animation must not freeze the server or interfere with normal gameplay.

---

  1. NO RESOURCE PACK AND NO CUSTOM HUD

This is a strict requirement.

  • Do not create a resource pack.
  • Do not require players to download a resource pack.
  • Do not create custom heart textures.
  • Do not create a custom HUD.
  • Do not rearrange the vanilla health bar.
  • Do not require client-side mods.
  • Do not create custom health-bar overlays.
  • Do not include resource-pack files in the final deliverables.

Golden Hearts and abilities must be tracked internally.

Use normal Minecraft health display. Do not pretend that Golden Hearts have a unique visual appearance in the vanilla health bar.

Players can see their own permitted Life Point information through commands.

---

  1. PVP LIFESTEAL SYSTEM

When a player successfully kills another player in eligible PvP:

  • The killer receives exactly 1 Life Point.
  • The killer never steals the victim's Golden Heart directly.
  • The killer never steals the victim's ability directly.
  • Only one Life Point is awarded per eligible kill.
  • Prevent repeated-kill and combat exploits.

Example 1: Normal Lifesteal

Victim:

  • 5 Life Points.
  • 0 Golden Hearts.

Killer:

  • 2 Life Points.

After the kill:

Killer: 3 Life Points.

Victim: 4 Life Points.

Example 2: Victim Has a Golden Heart

Victim:

  • 3 Life Points.
  • 1 Golden Heart.

Killer:

  • 2 Life Points.

The killer receives exactly 1 Life Point.

The killer does not receive the victim's Golden Heart or ability.

The victim's Golden Heart loss must follow the Golden Heart death rules configured for the server. Never transfer it to the killer.

Example 3: Victim Has Two Golden Hearts

Victim:

  • 0 Life Points.
  • 2 Golden Hearts.

After a qualifying death:

  • Remove exactly 1 Golden Heart.
  • The victim retains 1 Golden Heart.
  • The remaining ability stays active.
  • The killer receives exactly 1 Life Point.

Do not award additional Life Points as a side effect of losing a Golden Heart.

---

  1. ELIMINATION SYSTEM

A player is eliminated only when BOTH conditions are true:

  • Life Points = 0.
  • Golden Hearts = 0.

Example 1

Player:

  • 0 Life Points.
  • 1 Golden Heart.

Result: Not eliminated.

Example 2

Player:

  • 1 Life Point.
  • 0 Golden Hearts.

Result: Not eliminated.

Example 3

Player:

  • 0 Life Points.
  • 0 Golden Hearts.

Result: Eliminated.

When a player is eliminated:

  • Save their elimination status.
  • Prevent normal participation in Lifesteal gameplay.
  • Display an elimination message.
  • Do not permanently delete their data.
  • Allow another player to revive them through the Revival System.

---

  1. PLAYER REVIVAL SYSTEM

This is one of the most important features.

Ordinary players must be able to revive eliminated players.

Revival must not be restricted to admins.

Revival Cost

The revival cost is exactly:

1 Heart Item = 1 Life Point.

There is no separate revival currency.

Revival Process

  1. An eliminated player is selected as the revival target.
  2. Another player approaches the Revival Beacon.
  3. The player interacts with the beacon.
  4. The plugin checks whether the target is eliminated.
  5. The plugin checks whether the reviver has at least 1 Life Point.
  6. The plugin displays a confirmation message.
  7. The reviver confirms the action.
  8. The plugin consumes exactly 1 Heart Item/1 Life Point.
  9. The eliminated player is revived.
  10. The revived player receives exactly 1 Life Point.
  11. The revived player starts with 0 Golden Hearts.
  12. All previous Golden Heart abilities are removed.
  13. Normal gameplay access is restored.
  14. Both players receive success messages.

Important Revival Rule

The revived player starts fresh.

They do not recover:

  • Previous Golden Hearts.
  • Previous abilities.
  • Previous Life Point progress.

They start with exactly 1 Life Point.

Example 1: Successful Revival

Player A is eliminated.

Player B has 5 Life Points.

Player B revives Player A.

After revival:

Player B:

  • Before: 5 Life Points.
  • Cost: 1 Life Point.
  • After: 4 Life Points.

Player A:

  • Before: Eliminated.
  • After: 1 Life Point.
  • Golden Hearts: 0.
  • Abilities: None.

Example 2: Revived Player Earns a Golden Heart

Player A has just been revived.

Starting balance: 1 Life Point.

Player A earns 7 additional Life Points.

New balance: 8 Life Points.

The plugin:

  • Consumes 8 Life Points.
  • Awards 1 Golden Heart.
  • Randomly selects one eligible ability.

The revived player needs 7 additional Life Points to earn their first Golden Heart.

Example 3: Failed Revival

Player B has 0 Life Points.

Player B attempts to revive Player A.

Result:

  • Revival fails.
  • Player A remains eliminated.
  • Player B loses nothing.

Revival Security

  • Players cannot revive themselves.
  • Players cannot revive someone who is already alive.
  • Players cannot revive the same target twice.
  • Two players cannot revive the same target simultaneously.
  • Failed revival must never consume a Heart Item.
  • Prevent item duplication and transaction exploits.
  • Save revival status immediately.

---

  1. REVIVAL BEACON

Create a dedicated Revival Beacon or revival altar.

Requirements:

  • A special block or protected location.
  • A custom name displayed through normal Minecraft text.
  • Ordinary players can interact with it.
  • It opens a simple revival interface.
  • It displays eligible eliminated players.
  • It displays the cost of 1 Heart Item.
  • It asks for confirmation before spending.
  • It displays success or failure messages.
  • It cannot be destroyed or abused by ordinary players.

The beacon must work without a resource pack or client-side mod.

---

  1. PLAYER COMMANDS

Create these commands:

"/heart info"

Displays the player's permitted information, such as:

  • Current Life Points.
  • Golden Heart count if allowed by the server's visibility rules.
  • Owned abilities if allowed by the server's visibility rules.

"/heart revive <player>"

Starts the revival process for an eligible eliminated player.

The player must use the Revival Beacon or the configured confirmation process and provide the required 1 Heart Item.

Do not expose hidden information through ordinary player commands.

---

  1. ADMIN COMMANDS

Create the following administrative commands:

"/heart admin revive <player>"

Revives a player without the normal revival cost.

"/heart admin setpoints <player> <amount>"

Sets a player's Life Points.

"/heart admin addpoints <player> <amount>"

Adds Life Points.

"/heart admin removehearts <player> <amount>"

Removes Golden Hearts and their corresponding abilities.

"/heart admin reset <player>"

Resets the player's Lifesteal progress.

"/heart admin reload"

Reloads the plugin configuration.

Use separate permissions for administrative commands.

Only authorized administrators may use these commands.

---

  1. DATA STORAGE

Use SQLite for reliable persistent data storage.

Save:

  • Player UUID.
  • Life Points.
  • Golden Heart count.
  • Owned Golden Heart abilities.
  • Elimination status.
  • Revival history.
  • Relevant ability durations and states.

Requirements:

  • Data survives server restarts.
  • Data survives player disconnections.
  • Prevent duplicate rewards.
  • Prevent incomplete transactions.
  • Handle unexpected server shutdowns safely.
  • Never lose player progress when the plugin reloads.

---

  1. CONFIGURATION

Provide a clean and understandable "config.yml".

Allow configuration of:

  • Starting Life Points.
  • Life Points required per Golden Heart.
  • Maximum Golden Hearts.
  • Revival cost.
  • Revived player's starting Life Points.
  • Ability effects.
  • Temporary ability durations.
  • Reward animation settings.
  • Sounds.
  • Particle effects.
  • Revival Beacon location and settings.
  • Player messages.
  • Storage settings.

The default configuration must match the rules in this prompt.

---

  1. PERFORMANCE AND SECURITY

The plugin must:

  • Work efficiently with multiple players.
  • Avoid unnecessary repeating tasks.
  • Avoid memory leaks.
  • Prevent item duplication.
  • Prevent Life Point duplication.
  • Prevent Golden Heart duplication.
  • Prevent revival exploits.
  • Prevent repeated PvP reward exploits.
  • Use safe database operations.
  • Avoid blocking the server's main thread with database operations.
  • Validate all player interactions.
  • Handle disconnects and server restarts safely.

Include clear error messages and useful debugging logs.

---

  1. TESTING REQUIREMENTS

Before delivery, test all these cases:

  1. New players start with 2 Life Points.
  2. A successful PvP kill awards exactly 1 Life Point.
  3. Every 8 Life Points converts into 1 Golden Heart.
  4. Golden Heart awards a random ability.
  5. Exactly seven abilities exist.
  6. All eligible abilities have equal selection probability.
  7. Duplicate abilities are prevented.
  8. Maximum Golden Hearts are limited to 2.
  9. Losing a Golden Heart removes its associated ability.
  10. Zero Life Points with one Golden Heart does not cause elimination.
  11. Zero Life Points with zero Golden Hearts causes elimination.
  12. Ordinary players can revive eliminated players.
  13. Revival costs exactly 1 Heart Item/1 Life Point.
  14. The revived player starts with exactly 1 Life Point.
  15. The revived player starts with zero Golden Hearts.
  16. Previous abilities are not restored.
  17. Reaching 8 Life Points after revival grants a Golden Heart.
  18. Failed revival does not consume the reviver's item.
  19. Two players cannot revive the same target simultaneously.
  20. Server restart preserves all progress.
  21. No third Golden Heart can be awarded.
  22. No Guardian Heart exists anywhere in the project.
  23. No resource pack or custom HUD is required.
  24. No player can duplicate Life Points or Heart Items.

---

  1. FINAL DELIVERABLES

Deliver a complete working project containing:

  • Java source code.
  • Compiled plugin JAR.
  • Maven project.
  • "plugin.yml".
  • "config.yml".
  • SQLite storage implementation.
  • Installation instructions.
  • Configuration instructions.
  • Command and permission documentation.
  • Testing report.

Compile the plugin and test it on the actual target server version before delivering it.

Do not provide fake or incomplete implementations.

If a feature is not technically supported by the target Minecraft/Paper version, explain the limitation and provide a compatible solution.

FINAL PROJECT RULES

Heartbound SMP 2.0 must have:

  • 2 starting Life Points.
  • 8 Life Points for 1 Golden Heart.
  • Maximum 2 Golden Hearts.
  • Exactly 7 random Golden Heart abilities.
  • No duplicate abilities.
  • Exactly 1 Life Point awarded per eligible PvP kill.
  • Elimination only when both Life Points and Golden Hearts reach zero.
  • Ordinary-player revival costing exactly 1 Heart Item/1 Life Point.
  • Revived players starting with exactly 1 Life Point.
  • No restoration of previous Golden Hearts or abilities after revival.
  • No Guardian Heart.
  • No resource pack.
  • No custom HUD.

Build the complete Heartbound SMP 2.0 plugin according to these specifications.

Kodari AI
KodariYesterday at 12:30 pm 2

I can’t deliver this as a complete, tested plugin yet. Paper’s repository lists 26.3 API builds, but I can’t run the requested tests on an actual 26.3 server in this environment, and no source code or JAR has been created.

The revised design does not need a resource pack or client mod: Golden Hearts can be tracked internally, with rewards announced using vanilla effects.

ashwinbijarania0-glitch

Ok

Kodari AI
KodariYesterday at 12:32 pm 1

I can build the plugin source with the vanilla-only design. Actual Paper 26.3 server testing will still need to be done on a server.

ashwinbijarania0-glitch

The ablities

Kodari AI
KodariYesterday at 12:32 pm 1

What would you like to change about the seven abilities: their effects, durations, activation, or something else?

ashwinbijarania0-glitch

Ok now make it

Kodari AI
KodariYesterday at 12:34 pm 4

I’ll build the seven abilities into the full vanilla-only Lifesteal plugin, with SQLite-backed revival and progression. Golden Hearts will be tracked internally, not shown as custom HUD icons.

Created the Heartbound source project with all seven abilities, Lifesteal progression, SQLite storage, and beacon-based revival. Golden Hearts are tracked internally; no resource pack or custom HUD is used.

Not yet verified for production: I couldn’t compile it or run the requested tests on a Paper 26.3 server here, so I can’t claim a working JAR or completed testing report. The beacon menu currently lists up to 53 eliminated players; /heart revive <player> can select others.

Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pasted-code-1795264061285.txt
pom.xml
README.md
Code
7 1,076
src/main/java/com/heartbound/Heartbound.java
package com.heartbound;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.XPotion;
import com.cryptomorin.xseries.XSound;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.block.BlockExplodeEvent;
import org.bukkit.event.entity.EntityExplodeEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryDragEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.InventoryHolder;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

import java.io.File;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
import java.util.function.Consumer;

public final class Heartbound extends JavaPlugin implements Listener, CommandExecutor {
    private enum Ability {
        THUNDER("Speed I", "SPEED", "&b", "ENTITY_LIGHTNING_BOLT_THUNDER"),
        KNIGHT("Resistance I", "RESISTANCE", "&7", "ITEM_SHIELD_BLOCK"),
        WARRIOR("Strength I", "STRENGTH", "&c", "ENTITY_PLAYER_ATTACK_CRIT"),
        SOUL("Regeneration I", "REGENERATION", "&a", "BLOCK_SOUL_SAND_BREAK"),
        PHANTOM("Invisibility", "INVISIBILITY", "&5", "ENTITY_PHANTOM_AMBIENT"),
        PHOENIX("Fire Resistance", "FIRE_RESISTANCE", "&6", "ITEM_FIRECHARGE_USE"),
        OCEAN("Water Breathing", "WATER_BREATHING", "&9", "ENTITY_DOLPHIN_AMBIENT");
        final String effect, potion, color, sound;
        Ability(String effect, String potion, String color, String sound) {
            this.effect = effect; this.potion = potion; this.color = color; this.sound = sound;
        }
        String display() { return color + name() + " HEART"; }
    }

    private static final class State {
        final UUID id;
        String name;
        long points;
        boolean eliminated, notice;
        final List<Ability> abilities = new ArrayList<>();
        final Map<Ability, Long> expiry = new HashMap<>();
        State(UUID id, String name) { this.id = id; this.name = name; }
    }
    private static final class Menu implements InventoryHolder {
        final Map<Integer, UUID> targets = new HashMap<>();
        Inventory inventory;
        @Override public Inventory getInventory() { return inventory; }
    }
    private record Pending(UUID target, long expires) {}
    private record Settings(long cooldown, long soul, long phantom, boolean animation, int interval,
                            String particle, String startSound, String revealSound, String world,
                            int x, int y, int z, String beaconName, String eliminated, String revived,
                            String reward, String error) {}
    private interface Work<T> { T run() throws Exception; }

    private ExecutorService executor;
    private Connection db;
    private volatile Settings settings;
    private final Map<UUID, State> online = new HashMap<>();
    private final Map<UUID, Pending> pending = new HashMap<>();
    private volatile boolean stopping;

    @Override public void onEnable() {
        saveDefaultConfig();
        loadSettings();
        executor = Executors.newSingleThreadExecutor(r -> new Thread(r, "Heartbound-SQLite"));
        String filename = getConfig().getString("storage.file", "heartbound.db");
        if (filename == null || !filename.matches("[a-zA-Z0-9_.-]+") || filename.equals(".") || filename.equals("..")) {
            getLogger().severe("Invalid storage.file; disabling Heartbound.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        submit(() -> { openDatabase(filename); return null; }, ignored -> {}, null);
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("heart").setExecutor(this);
        Bukkit.getScheduler().runTaskTimer(this, () -> {
            for (Player player : Bukkit.getOnlinePlayers()) {
                State state = online.get(player.getUniqueId());
                if (state != null && !state.eliminated) applyEffects(player, state);
            }
        }, 20L, 100L);
        for (Player p : Bukkit.getOnlinePlayers()) loadPlayer(p);
    }

    @Override public void onDisable() {
        stopping = true;
        if (executor != null) {
            executor.execute(() -> { try { if (db != null) db.close(); } catch (SQLException e) { getLogger().severe(e.toString()); } });
            executor.shutdown();
            try { if (!executor.awaitTermination(30, TimeUnit.SECONDS)) getLogger().severe("Database shutdown timed out; queued operations may not be saved."); }
            catch (InterruptedException e) { Thread.currentThread().interrupt(); }
        }
    }

    private void loadSettings() {
        FileConfiguration c = getConfig();
        settings = new Settings(Math.max(0, c.getLong("kill-cooldown-seconds", 300)) * 1000L,
                Math.max(1, c.getLong("abilities.soul-duration-seconds", 30)) * 1000L,
                Math.max(1, c.getLong("abilities.phantom-duration-seconds", 30)) * 1000L,
                c.getBoolean("animation.enabled", true), Math.max(1, c.getInt("animation.interval-ticks", 8)),
                c.getString("animation.particle", "TOTEM_OF_UNDYING"), c.getString("animation.start-sound", "BLOCK_BEACON_ACTIVATE"),
                c.getString("animation.reveal-sound", "UI_TOAST_CHALLENGE_COMPLETE"), c.getString("beacon.world", ""),
                c.getInt("beacon.x"), c.getInt("beacon.y"), c.getInt("beacon.z"), c.getString("beacon.name", "&6Revival Beacon"),
                c.getString("messages.eliminated", "&cYou have been eliminated."), c.getString("messages.revived", "&aYou have been revived."),
                c.getString("messages.reward", "&6You received a Golden Heart!"), c.getString("messages.error", "&cDatabase error."));
    }
    private String color(String text) { return ChatColor.translateAlternateColorCodes('&', text == null ? "" : text); }
    private void tell(CommandSender sender, String text) { sender.sendMessage(color(text)); }
    private <T> void submit(Work<T> work, Consumer<T> success, UUID recipient) {
        if (stopping) return;
        executor.execute(() -> {
            try {
                T result = work.run();
                if (!stopping) Bukkit.getScheduler().runTask(this, () -> success.accept(result));
            } catch (Exception e) {
                getLogger().severe("Heartbound operation failed: " + e);
                if (!stopping && recipient != null) Bukkit.getScheduler().runTask(this, () -> {
                    Player p = Bukkit.getPlayer(recipient); if (p != null) tell(p, settings.error());
                });
            }
        });
    }
    private void openDatabase(String filename) throws Exception {
        Class.forName("org.sqlite.JDBC");
        db = DriverManager.getConnection("jdbc:sqlite:" + new File(getDataFolder(), filename).getAbsolutePath());
        try (Statement s = db.createStatement()) {
            s.execute("PRAGMA journal_mode=WAL"); s.execute("PRAGMA synchronous=FULL"); s.execute("PRAGMA busy_timeout=5000");
            s.execute("CREATE TABLE IF NOT EXISTS players (uuid TEXT PRIMARY KEY, name TEXT NOT NULL, points INTEGER NOT NULL, eliminated INTEGER NOT NULL, notice INTEGER NOT NULL DEFAULT 0)");
            s.execute("CREATE TABLE IF NOT EXISTS abilities (uuid TEXT NOT NULL, ability TEXT NOT NULL, expires INTEGER NOT NULL, position INTEGER NOT NULL, PRIMARY KEY(uuid,ability))");
            s.execute("CREATE TABLE IF NOT EXISTS kills (killer TEXT NOT NULL, victim TEXT NOT NULL, last INTEGER NOT NULL, PRIMARY KEY(killer,victim))");
            s.execute("CREATE TABLE IF NOT EXISTS revivals (id INTEGER PRIMARY KEY AUTOINCREMENT, target TEXT NOT NULL, reviver TEXT, time INTEGER NOT NULL, admin INTEGER NOT NULL)");
        }
    }
    private State get(UUID id) throws SQLException {
        if (db == null) throw new SQLException("Storage not initialized");
        try (PreparedStatement q = db.prepareStatement("SELECT name,points,eliminated,notice FROM players WHERE uuid=?")) {
            q.setString(1, id.toString());
            try (ResultSet r = q.executeQuery()) {
                if (!r.next()) return null;
                State s = new State(id, r.getString(1)); s.points = r.getLong(2); s.eliminated = r.getInt(3) != 0; s.notice = r.getInt(4) != 0;
                try (PreparedStatement a = db.prepareStatement("SELECT ability,expires FROM abilities WHERE uuid=? ORDER BY position")) {
                    a.setString(1, id.toString());
                    try (ResultSet ar = a.executeQuery()) { while (ar.next()) { Ability ability = Ability.valueOf(ar.getString(1)); s.abilities.add(ability); s.expiry.put(ability, ar.getLong(2)); } }
                }
                return s;
            }
        }
    }
    private void save(State s) throws SQLException {
        try (PreparedStatement p = db.prepareStatement("INSERT INTO players(uuid,name,points,eliminated,notice) VALUES(?,?,?,?,?) ON CONFLICT(uuid) DO UPDATE SET name=excluded.name,points=excluded.points,eliminated=excluded.eliminated,notice=excluded.notice")) {
            p.setString(1, s.id.toString()); p.setString(2, s.name); p.setLong(3, s.points); p.setInt(4, s.eliminated ? 1 : 0); p.setInt(5, s.notice ? 1 : 0); p.executeUpdate();
        }
        try (PreparedStatement d = db.prepareStatement("DELETE FROM abilities WHERE uuid=?")) { d.setString(1, s.id.toString()); d.executeUpdate(); }
        try (PreparedStatement p = db.prepareStatement("INSERT INTO abilities(uuid,ability,expires,position) VALUES(?,?,?,?)")) {
            for (int i = 0; i < s.abilities.size(); i++) { Ability a = s.abilities.get(i); p.setString(1, s.id.toString()); p.setString(2, a.name()); p.setLong(3, s.expiry.getOrDefault(a, 0L)); p.setInt(4, i); p.addBatch(); } p.executeBatch();
        }
    }
    private <T> T transaction(Work<T> work) throws Exception {
        if (db == null) throw new SQLException("Storage not initialized");