Y
📎 1 file 10,307 chars
📄
pasted-code-1790101190362.txt
txt 602 lines
▶
COREXLIFE — ADVANCED LIFESTEAL PLUGIN

Create a complete, production-ready Minecraft Java plugin named CoreXLife.

PLATFORM

- Minecraft: Paper 1.21.1
- Java: 21
- Plugin API: Paper API
- Plugin name: "CoreXLife"
- Main class: "me.corexlife.CoreXLife"
- Author: "BETTERYASH"
- No NMS unless absolutely necessary.
- Use Adventure API for messages, titles, action bars and sounds.
- The plugin must be optimized for survival/Lifesteal SMP servers.

---

1. CORE LIFESTEAL SYSTEM

Create a complete custom Lifesteal system.

Default:

- New player starts with 10 hearts.
- 1 heart = 2 Minecraft health points.
- Hearts must be saved permanently.
- Player health must automatically update after joining, respawning, revival and heart changes.

Kill system:

When Player A kills Player B:

- Killer gains configurable hearts.
- Victim loses configurable hearts.
- Default: "+1 heart" to killer.
- Default: "-1 heart" to victim.
- Prevent accidental duplicate heart rewards from one death.
- Support configurable maximum and minimum hearts.

Example:

hearts:
  starting: 10
  maximum: 40
  minimum: 0
  kill-reward: 1
  death-loss: 1

---

2. HEARTS OVER PLAYER HEAD

Display the player's current hearts above their head.

Example:

        ♥ 18
       BETTERYASH

Requirements:

- Update dynamically.
- Use a clean floating display.
- Do not spam packets/entities.
- Use the most optimized Paper-supported display method.
- Configurable format.
- Different colors based on health.
- Hide the display when configured.
- Support decimal hearts such as "10.5".

Example:

overhead:
  enabled: true
  format: "♥ "

---

3. SOUL HEAD SYSTEM

When a player is eliminated, create a special custom head.

The head must NOT be a normal player head.

Use:

- Custom display name
- Custom lore
- PersistentDataContainer tag
- Custom model data support
- Unique item identification

Example:

☠ Soul Head
Soul of BETTERYASH
Use at a Revival Altar to revive this player.

The head must store the UUID of the eliminated player.

This prevents players from creating fake revival heads.

---

4. ELIMINATION SYSTEM

If a player's hearts reach "0":

- Mark the player as eliminated.
- Save their elimination state.
- Prevent normal survival gameplay according to configuration.
- Drop their Soul Head.
- Play a custom elimination animation.
- Send an announcement to the server.
- Spawn configurable particles.
- Play configurable sounds.

Example announcement:

☠ BETTERYASH has been eliminated!
Their Soul Head has dropped.

Do NOT permanently ban the Minecraft account.

---

5. REVIVAL ALTAR

Create a special Revival Altar system.

The altar should be configurable and protected.

Default recipe/setup:

Allow administrators to define the altar structure through configuration.

Example:

   E E E
   E C E
   E E E

Where:

- "E" = configurable special block
- "C" = center block

The plugin must detect whether a valid altar exists.

---

6. REVIVAL USING SOUL HEAD

A player places/uses a valid Soul Head on the Revival Altar.

The plugin must:

1. Verify the head.
2. Read the eliminated player's UUID.
3. Verify that the target player is actually eliminated.
4. Start a revival sequence.
5. Lock/cancel the process if the altar is destroyed.
6. Consume the Soul Head only after successful revival.
7. Restore the target player's configured starting/revival hearts.
8. Remove their eliminated state.
9. Send revival announcement.

Example:

✨ REVIVAL COMPLETE ✨
BETTERYASH has returned to life!

---

7. REVIVAL ANIMATION

Create a cinematic revival effect.

During revival:

- Soul particles rise from the altar.
- Circular particles rotate around the altar.
- Heart particles appear.
- Light/flash effect.
- Configurable sound sequence.
- Title and subtitle.
- Configurable duration.
- Final burst effect.

Example:

       ✦
    ✦  ☠  ✦
       ↑
   ✨ SOUL ✨
       ↑
    REVIVAL

The animation must be optimized and must not create thousands of particles.

---

8. FIVE CUSTOM WEAPONS

Create 5 unique weapons.

Each weapon must have:

- Custom name
- Custom lore
- Unique material
- PersistentDataContainer ID
- Custom ability
- Cooldown
- Particles
- Sounds
- Configurable damage/effects
- Permission support

Weapon 1 — Void Blade

Theme: Void / Shadow

Ability:

"Void Step"

When activated:

- Teleport the player a configurable distance forward.
- Spawn dark/purple particles.
- Play teleport sound.
- Add short cooldown.

Command:

/corexlife give  voidblade

---

Weapon 2 — Inferno Axe

Theme: Fire

Ability:

"Inferno Burst"

When activated:

- Create a controlled circular fire burst.
- Damage nearby enemies.
- Apply short fire effect.
- Spawn flame/lava particles.
- Play fire sound.

Do NOT create uncontrollable permanent fire.

---

Weapon 3 — Tidal Trident

Theme: Water

Ability:

"Tidal Crash"

When activated:

- Create a water-wave visual effect.
- Push nearby enemies backwards.
- Spawn water/bubble particles.
- Play trident/water sound.

---

Weapon 4 — Storm Katana

Theme: Lightning

Ability:

"Storm Strike"

When activated:

- Select nearby target.
- Strike lightning effect at target.
- Damage target.
- Spawn electric particles.
- Play thunder sound.

The lightning should be controlled and configurable.

---

Weapon 5 — Soul Scythe

Theme: Soul / Life

Ability:

"Soul Drain"

When hitting an enemy:

- Spawn soul particles.
- Apply configurable damage.
- Give the attacker a small configurable regeneration effect.
- Add cooldown to prevent abuse.

Do not allow this weapon to bypass the configured maximum hearts.

---

9. CUSTOM PARTICLE SYSTEM

Create a reusable particle manager.

Include effects such as:

- Heart burst
- Soul spiral
- Void portal
- Fire burst
- Water wave
- Lightning circle
- Revival beam
- Elimination explosion
- Kill effect

Every particle effect must be configurable.

Example:

particles:
  revival:
    enabled: true
    count: 80
    radius: 2.5

Avoid excessive particle spawning.

---

10. KILL EFFECTS

When a player gets a Lifesteal kill:

- Play configurable sound.
- Show heart particles.
- Display action bar:

❤ +1 Heart

Optional:

KILL STREAK: 5

Add configurable kill-streak effects.

---

11. COMMANDS

Implement:

/corexlife
/corexlife help
/corexlife reload
/corexlife info

/corexlife hearts  
/corexlife addheart  
/corexlife removeheart  
/corexlife sethearts  

/corexlife eliminate 
/corexlife revive 

/corexlife give  
/corexlife givehead  

/corexlife altar

Add tab completion.

---

12. PERMISSIONS

Create permissions:

corexlife.admin
corexlife.reload
corexlife.hearts
corexlife.revive
corexlife.give
corexlife.altar

Use proper permission checks.

---

13. CONFIGURATION

Create a complete "config.yml".

Include:

- Starting hearts
- Maximum hearts
- Minimum hearts
- Kill reward
- Death loss
- Overhead health
- Soul Head settings
- Revival settings
- Altar settings
- Weapon settings
- Ability cooldowns
- Damage values
- Particle settings
- Sound settings
- Messages
- World restrictions
- Debug mode

Never hardcode values that should reasonably be configurable.

---

14. DATA STORAGE

Store player data safely.

Minimum data:

UUID
current hearts
eliminated status
last known name

Data must survive:

- Server restart
- Player logout
- Crash/restart where possible

Use YAML or SQLite.

Prefer SQLite for production reliability.

---

15. ANTI-EXPLOIT PROTECTION

Prevent:

- Duplicate heart rewards.
- Duplicate Soul Heads.
- Fake revival heads.
- Reviving a player who is already alive.
- Multiple revival triggers.
- Killing the same player repeatedly for infinite rewards.
- Weapon ability spam.
- Invalid custom items being treated as real CoreXLife items.
- Dropping/duplicating Soul Heads through exploits.

Use UUID/PersistentDataContainer based identification.

---

16. PERFORMANCE

The plugin must be optimized.

Requirements:

- Do not run unnecessary repeating tasks for every player.
- Do not spawn excessive particles.
- Cancel tasks when no longer needed.
- Avoid synchronous database operations during combat events.
- Cache frequently accessed player data.
- Clean up cached data when appropriate.
- Avoid memory leaks.
- Use Paper events/API wherever possible.

---

17. MESSAGES

Use modern MiniMessage formatting.

Example:

COREXLIFE

Messages should be configurable.

Examples:

❤ You gained 1 heart!
☠ You lost 1 heart!
☠ You have been eliminated!
✨ You have been revived!
⚔ Ability activated!
⏳ Ability is on cooldown!

---

18. TAB COMPLETION

Every command must have intelligent tab completion.

Example:

/corexlife give BETTERYASH 

Shows:

voidblade
infernoaxe
tidaltrident
stormkatana
soulscythe

---

19. PLUGIN FILE STRUCTURE

Create a clean professional project:

CoreXLife/
├── src/main/java/me/corexlife/
│   ├── CoreXLife.java
│   ├── command/
│   ├── listener/
│   ├── manager/
│   ├── weapon/
│   ├── revival/
│   ├── hearts/
│   ├── particles/
│   ├── data/
│   └── util/
│
├── src/main/resources/
│   ├── plugin.yml
│   ├── config.yml
│   └── messages.yml
│
└── pom.xml

Use proper OOP architecture.

Do NOT put the entire plugin inside one huge class.

---

20. IMPORTANT QUALITY REQUIREMENTS

The final result must:

- Compile without errors.
- Work on Paper 1.21.1.
- Use Java 21.
- Have no missing classes.
- Have no placeholder methods.
- Have no fake APIs.
- Have no TODO sections pretending to be finished.
- Register all commands/listeners correctly.
- Include complete "plugin.yml".
- Include complete configuration files.
- Include comments for complicated systems.
- Handle null players/items/worlds safely.
- Handle server restart correctly.

At the end, provide:

1. Complete source code.
2. "pom.xml".
3. "plugin.yml".
4. "config.yml".
5. "messages.yml".
6. Build instructions.
7. Installation instructions.
8. All commands and permissions.
9. Explanation of how the Revival Altar works.

The final plugin should feel like a polished custom Lifesteal SMP core rather than a basic Lifesteal plugin.

Plugin branding:

COREXLIFE

Author/creator branding:

BETTERYASH

Do not add staff ranks, store systems, economy systems, or unrelated features unless specifically requested.
Kodari AI
KodariSep 22 at 6:30 pm 3
CoreXLife
CoreXLife is a comprehensive Lifesteal SMP plugin for Paper 1.21.1, featuring a persistent hearts system with kill rewards and death penalties, dynamic health display above player heads, an elimination system that drops unique Soul Heads, and a configurable Revival Altar for bringing eliminated players back. It includes five custom weapons with unique abilities, a reusable particle system, full command and permission support, SQLite data storage, and extensive anti-exploit protections. All messages use MiniMessage formatting, and every aspect is configurable through YAML files.

I’ll create the complete CoreXLife Maven project with SQLite-backed hearts, Paper display entities, validated revival altars, custom weapons, commands, listeners, configuration, and message files.

Created the CoreXLife project with:

  • Paper 1.21.1 / Java 21 Maven setup

  • SQLite-backed persistent player hearts

  • Lifesteal kill rewards and death losses

  • Elimination and spectator handling

  • Soul Head PDC validation

  • Revival Altar with cancellable revival animation

  • Floating Paper TextDisplay heart indicators

  • Five custom weapons and abilities

  • Particle and sound effects

  • Configurable MiniMessage messages

  • Admin commands and tab completion

  • Permissions and complete configuration files

  • Dependency packaging through Maven Assembly

Build

Shell
mvn clean package

Use:

Plain Text
target/CoreXLife-1.0.0-jar-with-dependencies.jar

Place it in:

Plain Text
/plugins

The SQLite database will be created at:

Plain Text
/plugins/CoreXLife/corexlife.db

Revival Altar

Build a flat 3×3 structure:

Plain Text
SOUL_SAND SOUL_SAND SOUL_SAND
SOUL_SAND ENCHANTING_TABLE SOUL_SAND
SOUL_SAND SOUL_SAND SOUL_SAND

Right-click the center enchanting table with a valid Soul Head. The altar is checked throughout the revival sequence and cancels if any required block is broken. The Soul Head is consumed only after successful revival.

Main Commands

Plain Text
/corexlife help
/corexlife reload
/corexlife info
/corexlife hearts <player>
/corexlife addheart <player> <amount>
/corexlife removeheart <player> <amount>
/corexlife sethearts <player> <amount>
/corexlife eliminate <player>
/corexlife revive <player>
/corexlife give <player> <weapon>
/corexlife givehead <player> <target>
/corexlife altar

Permissions

Plain Text
corexlife.admin
corexlife.reload
corexlife.hearts
corexlife.revive
corexlife.give
corexlife.altar
corexlife.weapon.voidblade
corexlife.weapon.infernoaxe
corexlife.weapon.tidaltrident
corexlife.weapon.stormkatana
corexlife.weapon.soulscythe
Kodari can make mistakes. Review important code before using.
Files
src
manifest.kod
pom.xml
Code
19 830
src/main/java/me/corexlife/CoreXLife.java
package me.corexlife;

import me.corexlife.command.CoreCommand;
import me.corexlife.data.DataManager;
import me.corexlife.hearts.HeartsManager;
import me.corexlife.listener.CoreListener;
import me.corexlife.manager.CooldownManager;
import me.corexlife.manager.DisplayManager;
import me.corexlife.particles.ParticleManager;
import me.corexlife.revival.RevivalManager;
import me.corexlife.util.MessageUtil;
import me.corexlife.weapon.WeaponManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class CoreXLife extends JavaPlugin {
    private DataManager dataManager;
    private MessageUtil messages;
    private HeartsManager heartsManager;
    private ParticleManager particleManager;
    private DisplayManager displayManager;
    private CooldownManager cooldownManager;
    private WeaponManager weaponManager;
    private RevivalManager revivalManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        messages = new MessageUtil(this);
        dataManager = new DataManager(this);
        particleManager = new ParticleManager(this);
        cooldownManager = new CooldownManager();
        heartsManager = new HeartsManager(this, dataManager, messages, particleManager);
        displayManager = new DisplayManager(this, heartsManager, messages);
        weaponManager = new WeaponManager(this, cooldownManager, particleManager, messages);
        revivalManager = new RevivalManager(this, heartsManager, particleManager, messages);

        CoreListener listener = new CoreListener(this, heartsManager, displayManager, weaponManager, revivalManager);
        Bukkit.getPluginManager().registerEvents(listener, this);
        CoreCommand command = new CoreCommand(this, heartsManager, weaponManager, messages);
        getCommand("corexlife").setExecutor(command);
        getCommand("corexlife").setTabCompleter(command);
        getLogger().info("CoreXLife enabled.");
    }

    @Override
    public void onDisable() {
        if (revivalManager != null) revivalManager.cancelAll();
        if (displayManager != null) displayManager.removeAll();
        if (dataManager != null) dataManager.saveAll();
        if (dataManager != null) dataManager.close();
    }

    public MessageUtil messages() { return messages; }
    public DataManager data() { return dataManager; }
    public HeartsManager hearts() { return heartsManager; }
}