66m8e

BLASTSTEAL – ULTIMATE LIFESTEAL PLUGIN

Create a powerful, lightweight, fully functional and optimized Minecraft Lifesteal plugin.

  1. BASIC INFORMATION

Plugin Name: BLASTSTEAL Plugin Prefix: &8[&cBLASTMC&8] Plugin File Name: BLASTSTEAL.jar Platform: Paper Language: Java Plugin Type: Lifesteal Default Maximum Hearts: 20 Default Starting Hearts: 10

  1. MINECRAFT VERSION SUPPORT

MAIN PRIORITY: Minecraft 26.3 Paper.

Also support Minecraft 26.2 Paper, 26.1 Paper, 1.21.11 Paper and compatible patch releases wherever technically possible.

  • Develop primarily for Minecraft 26.3 Paper.
  • Test every supported version.
  • Automatically detect server versions.
  • Use compatible Paper/Bukkit APIs.
  • Avoid unnecessary NMS dependencies.
  • Prefer one universal JAR if technically possible.
  • Otherwise provide the minimum number of version-specific builds.
  • Never claim untested compatibility.
  • Clearly list tested and untested versions.
  1. OP ADMIN COMMANDS

Only OP players can use these commands.

Give Hearts: /blaststeal give heart [amount]

  • Give the specified hearts to yourself.
  • Validate the amount.

Set Player Hearts: /blaststeal set heart [PLAYER NAME] [SET AMOUNT]

  • Set a player's exact heart amount.
  • Support offline players.
  • Save changes immediately.

Set Maximum Hearts: /blaststeal setmax heart [amount]

  • Change the maximum heart limit.
  • Default maximum is 20 hearts.
  • Apply the new limit correctly.

Help: /blaststeal help

  • Display all available commands.
  1. NORMAL PLAYER COMMANDS (DEOP)

Withdraw Heart: /withdraw heart [amount]

  • Allow all normal players to withdraw hearts.
  • Deduct the requested hearts from their health.
  • Give the player the correct number of RED WOOL items.
  • Each Red Wool represents exactly ONE heart.
  • Give Red Wool a custom display name and lore.
  • Example name: &c❤ Heart
  • Right-click Red Wool to consume it.
  • Consuming one Red Wool restores exactly one heart.
  • Remove the item only after successful consumption.
  • Prevent fake items and duplication.
  • Prevent players from exceeding maximum hearts.
  • Validate all amounts.
  1. HEART STEALING SYSTEM (VERY IMPORTANT)

When a player kills another player:

  • The victim loses exactly 1 heart.
  • The killer automatically receives exactly 1 heart.
  • The killer must not need to pick up any item.
  • Do not drop a heart item automatically.
  • Update both players' hearts immediately.
  • Never exceed the maximum heart limit.
  • Save both players' data.

NATURAL DEATH PROTECTION Hearts must NEVER be lost or transferred when a player dies naturally.

Examples: Zombie, skeleton, creeper, fall damage, lava, fire, drowning, starvation, suffocation, environmental damage or any other non-player-caused death.

Rules:

  • Natural death = NO heart loss.
  • Natural death = NO heart transfer.
  • Natural death = NO automatic heart drop.
  • Only a confirmed player-versus-player kill triggers Lifesteal.
  • Prevent environmental deaths from accidentally counting as PvP kills.
  • Handle delayed damage correctly, such as a player burning after being hit.
  1. TEMPORARY BAN SYSTEM

Elimination-based temporary bans: 1st elimination: 3 Hours 2nd elimination: 6 Hours 3rd elimination: 6 Hours 4th elimination: 12 Hours 5th and later: 12 Hours IMPORTANT RULES:

  • NEVER permanently ban players.
  • All bans must be temporary.
  • When a player's hearts reach zero, activate the temporary ban.
  • Count eliminations correctly.
  • Store elimination counts permanently.
  • Store ban expiration timestamps.
  • Automatically allow joining after expiration.
  • Display remaining ban time on join attempts.
  • Preserve ban data after server restart.
  • Do not reset elimination counts when bans expire.
  • Prevent duplicate ban processing.
  1. HEART LIMIT SYSTEM
  • Default maximum hearts: 20.
  • Starting hearts: 10.
  • One heart = 2 health points.
  • Never allow more than the configured maximum.
  • Never allow negative hearts.
  • Ensure withdrawn hearts and consumed Red Wool respect the limit.
  • Handle offline players correctly.
  1. MESSAGE DESIGN

Every message must use this prefix: &8[&cBLASTMC&8] Use Minecraft & color codes.

Create professional messages for: heart stolen, heart received, heart lost, heart withdrawn, Red Wool heart received, heart consumed, maximum hearts reached, invalid amount, player not found, no permission, player eliminated, temporary ban activated, remaining ban time, ban expired and help menu.

  1. PERMISSIONS

OP: Full administrative command access.

DEOP: /withdraw heart [amount].

Normal players cannot use administrative commands. Display permission-denied messages.

  1. DATA STORAGE & PERFORMANCE
  • Use lightweight YAML or SQLite.
  • Save player hearts.
  • Save maximum heart settings.
  • Save elimination counts.
  • Save temporary ban expiration timestamps.
  • Preserve all data after restart.
  • Prevent item duplication and heart duplication exploits.
  • Use efficient event handling.
  • Avoid unnecessary repeating tasks and dependencies.
  • No memory leaks.
  • No console errors.
  1. AI CREDIT OPTIMIZATION

I want this plugin generated using approximately 6 AI credits/coins, if supported by the AI platform.

  • Use minimum possible credits.
  • Generate the complete plugin in one generation.
  • Keep implementation compact.
  • Do not waste credits on explanations.
  • Do not repeatedly regenerate working code.
  • Do not add unnecessary features or files.
  • Avoid unnecessary dependencies.
  • Fix compilation errors before delivery.
  • Keep code efficient without sacrificing functionality.
  1. FINAL DELIVERY

Deliver:

  1. Complete BLASTSTEAL plugin source code.
  2. Required configuration files.
  3. Correct plugin name: BLASTSTEAL.jar.
  4. Build instructions.
  5. Installation instructions.
  6. Confirmed Minecraft version compatibility.
  7. Clearly identify tested and untested versions.
  8. Complete, compilable Java source code.

FINAL INSTRUCTIONS Create a real, fully functional BLASTSTEAL Lifesteal plugin.

Remember these three most important rules:

  1. Only player kills steal hearts. Natural deaths never steal hearts.
  2. The killer automatically receives the victim's stolen heart.
  3. Withdrawing hearts gives RED WOOL, and right-clicking RED WOOL restores one heart.

NEVER permanently ban any player. All elimination bans must be temporary.

No pseudocode, no incomplete methods, no fake features, and no unnecessary files.

MAIN DEVELOPMENT TARGET: MINECRAFT 26.3 PAPER.

Kodari AI
KodariNov 9 at 5:34 pm 2
BlastSteal
BlastSteal is a comprehensive Lifesteal plugin for Paper servers. It implements a heart-stealing PvP system where killers automatically receive one heart from victims upon confirmed player kills, while natural deaths never trigger heart loss. Players can withdraw hearts as consumable Red Wool items that restore health when right-clicked. The plugin features an elimination-based temporary ban system with escalating durations (3-12 hours), configurable heart limits, persistent YAML data storage, and OP administrative commands for managing hearts. Includes full permission handling, professional message formatting with plugin prefix, and support for offline player data management.
  1. Add the Paper plugin metadata and default heart configuration.

  2. Implement heart storage, PvP-only stealing, signed Red Wool, commands, and temporary elimination bans.

  3. Set the jar name to BLASTSTEAL.jar; leave version testing claims explicitly unverified.

Implemented BLASTSTEAL with heart tracking, PvP kill transfers, single-use Red Wool hearts, OP admin commands, persistent data, and temporary elimination bans.

  • Build/download: On desktop click Compile in the top bar; on phone tap ⋮ → Compile Project. Click Compile, then Download when it succeeds. The configured jar name is BLASTSTEAL.jar.

  • Install: Put the jar in the Paper server’s plugins folder and restart the server.

  • Compatibility: Targeted at Paper 26.3. I could not test versions here; compatibility with Paper 26.2, 26.1, and 1.21.11 is unverified.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 559
src/main/java/com/blastmc/blaststeal/BlastStealPlugin.java
package com.blastmc.blaststeal;

import com.cryptomorin.xseries.XAttribute;
import com.cryptomorin.xseries.XMaterial;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import java.util.logging.Level;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.NamespacedKey;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.YamlConfiguration;

public final class BlastStealPlugin extends org.bukkit.plugin.java.JavaPlugin implements Listener, CommandExecutor {
    private static final String PREFIX = "&8[&cBLASTMC&8] ";
    private static final long HOUR_MILLIS = 60L * 60L * 1000L;

    private final Set<UUID> expiredOnLogin = new HashSet<>();
    private int maximumHearts;
    private int startingHearts;
    private File dataFile;
    private YamlConfiguration data;
    private NamespacedKey heartTokenKey;
    private Material redWool;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        maximumHearts = Math.max(1, getConfig().getInt("maximum-hearts", 20));
        startingHearts = Math.max(1, Math.min(maximumHearts, getConfig().getInt("starting-hearts", 10)));
        dataFile = new File(getDataFolder(), "data.yml");
        data = YamlConfiguration.loadConfiguration(dataFile);
        heartTokenKey = new NamespacedKey(this, "heart-token");
        redWool = XMaterial.matchXMaterial("RED_WOOL").map(XMaterial::parseMaterial).orElse(null);
        if (redWool == null) {
            getLogger().severe("RED_WOOL is not available; disabling BLASTSTEAL.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        getServer().getPluginManager().registerEvents(this, this);
        getCommand("blaststeal").setExecutor(this);
        getCommand("withdraw").setExecutor(this);
        for (Player player : Bukkit.getOnlinePlayers()) {
            ensurePlayer(player.getUniqueId());
            updateHealth(player, getHearts(player.getUniqueId()), 0.0);
        }
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        ensurePlayer(player.getUniqueId());
        updateHealth(player, getHearts(player.getUniqueId()), 0.0);
        if (expiredOnLogin.remove(player.getUniqueId())) {
            message(player, "&aYour temporary elimination ban has expired. Welcome back.");
        }
    }

    @EventHandler(priority = EventPriority.HIGHEST)
    public void onPlayerLogin(PlayerLoginEvent event) {
        UUID uuid = event.getPlayer().getUniqueId();
        long banUntil = data.getLong(playerPath(uuid, "ban-until"), 0L);
        long now = System.currentTimeMillis();
        if (banUntil > now) {
            event.disallow(PlayerLoginEvent.Result.KICK_OTHER,
                    color(PREFIX + "&cYou are temporarily banned after elimination. Time remaining: &f"
                            + formatRemaining(banUntil - now) + "&c."));
        } else if (banUntil > 0L) {
            data.set(playerPath(uuid, "ban-until"), 0L);
            expiredOnLogin.add(uuid);
            saveData();
        }
    }

    @EventHandler
    public void onPlayerDeath(PlayerDeathEvent event) {
        Player victim = event.getEntity();
        Player killer = victim.getKiller();
        if (killer == null || killer.getUniqueId().equals(victim.getUniqueId())) {
            return;
        }

        UUID victimId = victim.getUniqueId();
        UUID killerId = killer.getUniqueId();
        ensurePlayer(victimId);
        ensurePlayer(killerId);
        int victimHearts = getHearts(victimId);
        if (victimHearts <= 0) {
            return;
        }

        int remainingHearts = victimHearts - 1;
        setHearts(victimId, remainingHearts, 0.0);
        message(victim, "&cYou lost 1 heart to &f" + killer.getName() + "&c.");

        int killerHearts = getHearts(killerId);
        if (killerHearts < maximumHearts) {
            setHearts(killerId, killerHearts + 1, 0.0);
            message(killer, "&aYou received 1 heart stolen from &f" + victim.getName() + "&a.");
        } else {
            message(killer, "&eYou stole a heart, but you are already at the maximum of "
                    + maximumHearts + " hearts.");
        }

        if (remainingHearts == 0) {
            eliminate(victim);
        }
    }

    @EventHandler
    public void onHeartInteract(PlayerInteractEvent event) {
        String token = getHeartToken(event.getItem());
        if (token == null) {
            return;
        }
        event.setCancelled(true);
        Player player = event.getPlayer();
        if (data.getBoolean("redeemed-tokens." + token, false)) {
            message(player, "&cThis heart item has already been used.");
            return;
        }

        UUID uuid = player.getUniqueId();
        ensurePlayer(uuid);
        int hearts = getHearts(uuid);
        if (hearts >= maximumHearts) {
            message(player, "&eYou have reached the maximum of " + maximumHearts + " hearts.");
            return;
        }

        data.set("redeemed-tokens." + token, true);
        setHearts(uuid, hearts + 1, 2.0);
        removeOneHeartItem(player, token);
        message(player, "&aYou consumed a heart and restored 1 heart.");
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("withdraw")) {
            return handleWithdraw(sender, args);
        }
        return handleBlastSteal(sender, args);
    }

    private boolean handleBlastSteal(CommandSender sender, String[] args) {
        if (args.length == 0 || args[0].equalsIgnoreCase("help")) {
            showHelp(sender);
            return true;
        }
        if (!sender.isOp()) {
            message(sender, "&cYou do not have permission to use administrative commands.");
            return true;
        }

        if (args[0].equalsIgnoreCase("give")) {
            if (args.length != 3 || !args[1].equalsIgnoreCase("heart")) {
                message(sender, "&cUsage: /blaststeal give heart <amount>");
                return true;
            }
            if (!(sender instanceof Player player)) {
                message(sender, "&cThis command gives hearts to yourself and can only be used in-game.");
                return true;
            }
            Integer amount = parsePositiveAmount(sender, args[2]);
            if (amount == null) {
                return true;
            }
            UUID uuid = player.getUniqueId();
            ensurePlayer(uuid);
            int before = getHearts(uuid);
            int after = (int) Math.min((long) maximumHearts, (long) before + amount);
            if (after == before) {
                message(sender, "&eYou have reached the maximum of " + maximumHearts + " hearts.");
            } else {
                setHearts(uuid, after, 0.0);
                message(sender, "&aYou received " + (after - before) + " heart(s). Hearts: " + after + "/" + maximumHearts + ".");
            }
            return true;