Yshs Hshsh

LifestealSMP plugin

Kodari AI
KodariSep 16 at 3:46 am 1
LifestealSMP
LifestealSMP is a Minecraft plugin that implements a heart-based PvP system where players lose a heart upon death and gain one when eliminating an opponent. When a player's hearts reach zero, they are banned from the server and enter a spectator mode. The plugin tracks heart counts persistently, provides configurable starting hearts, displays hearts in the tab list and action bar, and includes commands for admins to manage player hearts, revive banned players, and adjust the elimination threshold. It also features a kill-streak system that rewards players with bonus hearts for consecutive eliminations, along with configurable messages and cooldowns to prevent heart farming.
  1. Create the Gradle project and plugin metadata.

  2. Implement persistent heart storage and max-health synchronization.

  3. Add kill/death handling, commands, configuration, and messages.

Created the LifestealSMP plugin with:

  • Persistent heart storage in hearts.yml

  • Configurable starting, minimum, and maximum hearts

  • Heart gain on player kills

  • Heart loss on player deaths

  • Optional zero-heart banning

  • Max-health synchronization

  • /hearts command with permission-based player lookup

  • Gradle build configuration and plugin metadata

  • Configurable messages and settings

Yshs Hshsh

No kill streak. When player only have 1 heart you can't steal there heart. Player can reach max 30 heart. You can /withdraw hearts to drop your heart

Kodari AI
KodariSep 16 at 3:54 am 1
  1. Remove any kill-streak behavior and enforce a hard 30-heart maximum.

  2. Prevent stealing from players at 1 heart.

  3. Add /withdraw <amount> to drop heart items from the command sender.

  1. Removed kill-streak behavior; none is included.

  2. Set the hard maximum to 30 hearts.

  3. Players with 1 heart cannot lose or have hearts stolen.

  4. Added /withdraw <amount> to remove hearts down to the 1-heart minimum and drop them as red heart items.

  5. Added command registration, usage messages, and configuration entries.

Yshs Hshsh

Player with 1 heart can steal other player heart

Kodari AI
KodariSep 16 at 3:56 am 1

Already supported: a player with 1 heart can kill another player and steal a heart.

The restriction only checks the victim:

Java
boolean canSteal = playerKill && victimHearts > heartManager.minimumHearts();

So:

  • Killer has 1 heart: can steal

  • Victim has 1 heart: cannot be stolen from

  • Victim has 2+ hearts: loses a heart and killer gains one

Yshs Hshsh

Make a heart texture

Kodari AI
KodariSep 16 at 5:16 am 1

[Generation stopped]

Yshs Hshsh

Make heart texture look like nether star

Kodari AI
KodariSep 16 at 5:17 am 1
  1. Update the withdrawn heart item to use a Nether Star appearance.

  2. Preserve the existing heart identification, display name, and withdrawal behavior.

[Generation stopped]

Yshs Hshsh

Make heart texture look like nether star and also you can right click to gain a heart

Kodari AI
KodariSep 16 at 5:19 am 1
  1. Make the withdrawn heart item use a Nether Star.

  2. Add right-click consumption so a player gains one heart, capped at 30.

  • Withdrawn hearts now use a Nether Star with a custom heart name and plugin-specific item tag.

  • Right-clicking a heart consumes one item and grants one heart.

  • Heart gains are capped at 30.

  • Right-clicking while already at 30 hearts leaves the item untouched and shows a message.

Yshs Hshsh

While already at 30 heart you can gain a heart

Kodari AI
KodariSep 16 at 5:22 am 1

A 30-heart player cannot gain another heart while the maximum remains 30. Should I:

  1. Keep the hard cap at 30 and prevent/return the heart item, or

  2. Remove the cap so players can exceed 30 hearts?

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
9 461
src/main/java/com/example/lifesteal/LifestealPlugin.java
package com.example.lifesteal;

import org.bukkit.plugin.java.JavaPlugin;

public final class LifestealPlugin extends JavaPlugin {

    private HeartManager heartManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();

        heartManager = new HeartManager(this);
        getServer().getPluginManager().registerEvents(new LifestealListener(this, heartManager), this);
        getCommand("hearts").setExecutor(new HeartsCommand(this, heartManager));
        getCommand("withdraw").setExecutor(new WithdrawCommand(heartManager));
    }

    public HeartManager getHeartManager() {
        return heartManager;
    }
}