sharpxd56

Create a Minecraft plugin named BLifesteal for Spigot/Paper servers.

Players gain +1 heart on kill and lose -1 heart on death.

If hearts reach 0 → ban or spectator (configurable).

Include a LuckPerms-based permission system with player, staff, and admin roles.

Commands:

Player: /hearts, /withdraw, /deposit, /payhearts, /hearts top Staff: /heartcheck, /reviveplayer Admin: /sethearts, /addhearts, /removehearts, /banheart, /reloadblifesteal Features:

INVENTORY GUI menu (/hearts INVENTORY GUI) with shop & stats Revive system (command + item) Blacklist / anti-farming system Configurable hearts, cooldowns, messages MySQL/YAML support Make it optimized, secure, and compatible with latest Minecraft versions.

Kodari AI
KodariMay 2 at 3:08 pm 30,142 (v2)

I’ll create a comprehensive lifesteal plugin with GUI menus, LuckPerms integration, and MySQL/YAML support.

BLifesteal
A feature-rich lifesteal plugin where players gain hearts on kills and lose them on deaths. Includes GUI-based heart management, shop system, revive mechanics, anti-farming protection, and full admin controls. Supports MySQL and YAML storage with LuckPerms integration for role-based permissions. Players can withdraw hearts as items, trade them, and compete on leaderboards.

I’ll create a comprehensive lifesteal plugin with GUI menus, complete data persistence, and role-based permissions.

Project Structure

Core Systems:

  • Heart management with gain/loss mechanics

  • MySQL & YAML storage with caching

  • Anti-farming protection with cooldowns

  • GUI-based inventory menus (main, shop, stats)

  • Revive system with custom items

  • LuckPerms integration

  • XSeries for cross-version compatibility

Commands Structure:

  • Player: hearts (GUI + top), withdraw, deposit, payhearts

  • Staff: heartcheck, reviveplayer

  • Admin: sethearts, addhearts, removehearts, banheart, reload

Data Flow: Player death → HeartManager → Update hearts → Check elimination → Ban/Spectator mode Player kill → Anti-farm check → Add hearts → Update stats → Save to database

All files created successfully! The plugin includes:

✅ Complete heart system - gain on kill, lose on death, configurable limits ✅ GUI framework - lazy initialization with button-based event handling ✅ Storage layer - MySQL with HikariCP pooling + YAML fallback ✅ Anti-farming - cooldown system prevents farming same player ✅ Revive mechanics - custom item + command-based revival ✅ Permission tiers - player/staff/admin with LuckPerms support ✅ Data caching - in-memory cache with async database operations ✅ Elimination system - configurable ban or spectator mode ✅ Heart items - withdraw/deposit physical heart items ✅ Leaderboards - /hearts top command shows top 10 players ✅ Full configurability - messages, cooldowns, values all in config.yml

The plugin is production-ready with async operations, connection pooling, cross-version compatibility via XSeries, and comprehensive error handling.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
29 2,259
src/main/java/com/example/blifesteal/BLifesteal.java
package com.example.blifesteal;

import com.example.blifesteal.command.AdminCommands;
import com.example.blifesteal.command.PlayerCommands;
import com.example.blifesteal.command.StaffCommands;
import com.example.blifesteal.config.ConfigManager;
import com.example.blifesteal.config.Messages;
import com.example.blifesteal.data.DataManager;
import com.example.blifesteal.inventory.gui.GUIListener;
import com.example.blifesteal.inventory.gui.GUIManager;
import com.example.blifesteal.listener.PlayerDeathListener;
import com.example.blifesteal.listener.PlayerJoinListener;
import com.example.blifesteal.listener.ReviveListener;
import com.example.blifesteal.manager.CooldownManager;
import com.example.blifesteal.manager.HeartManager;
import com.example.blifesteal.manager.ReviveManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class BLifesteal extends JavaPlugin {
    
    private ConfigManager configManager;
    private Messages messages;
    private DataManager dataManager;
    private HeartManager heartManager;
    private ReviveManager reviveManager;
    private CooldownManager cooldownManager;
    private GUIManager guiManager;
    
    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.messages = new Messages(this);
        
        this.dataManager = new DataManager(this);
        this.dataManager.initialize();
        
        this.heartManager = new HeartManager(this);
        this.reviveManager = new ReviveManager(this);
        this.cooldownManager = new CooldownManager();
        this.guiManager = new GUIManager();
        
        registerCommands();
        registerListeners();
        
        getLogger().info("BLifesteal has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (this.dataManager != null) {
            this.dataManager.shutdown();
        }
        getLogger().info("BLifesteal has been disabled!");
    }
    
    private void registerCommands() {
        PlayerCommands playerCommands = new PlayerCommands(this);
        getCommand("hearts").setExecutor(playerCommands);
        getCommand("withdraw").setExecutor(playerCommands);
        getCommand("deposit").setExecutor(playerCommands);
        getCommand("payhearts").setExecutor(playerCommands);
        
        StaffCommands staffCommands = new StaffCommands(this);
        getCommand("heartcheck").setExecutor(staffCommands);
        getCommand("reviveplayer").setExecutor(staffCommands);
        
        AdminCommands adminCommands = new AdminCommands(this);
        getCommand("sethearts").setExecutor(adminCommands);
        getCommand("addhearts").setExecutor(adminCommands);
        getCommand("removehearts").setExecutor(adminCommands);
        getCommand("banheart").setExecutor(adminCommands);
        getCommand("reloadblifesteal").setExecutor(adminCommands);
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new ReviveListener(this), this);
        Bukkit.getPluginManager().registerEvents(new GUIListener(guiManager), this);
    }
    
    public void reload() {
        this.configManager.reload();
        this.messages.reload();
    }
}