_ayush.xd_

Create a Minecraft 1.21 plugin for a "Headsteal SMP" server with the following features:

  1. Lives System:

- Every player starts with 10 lives. - When a player joins, show a pop-up with "You have X lives remaining". - When a player dies, their lives decrease by 1. - If lives reach 0, the player is permanently eliminated. - Show "ELIMINATED" on the player's screen when they die. - The killer sees the victim's name in dark red with "ELIMINATED". - Optionally, broadcast a server-wide message: "[Killer] eliminated [Player]" with colors.

  1. Headsteal Mechanic:

- When a player kills another, they receive the victim's head as an item. - Track total heads collected by each player. - Display total heads on the sidebar scoreboard or action bar.

  1. Life Potions:

- Craftable item that restores 1 life when consumed. - Rare recipe: e.g., Ghast Tear + Golden Apple + Nether Star. - When consumed, show pop-up: "You gained 1 life! Lives: X". - Add green particle effect around player on consumption. - Max lives cap (e.g., 10 or 12) to prevent abuse.

  1. Join & Death Pop-ups:

- On first join or rejoin, display lives remaining pop-up. - On death, show "ELIMINATED" big title + killer name in dark red. - Optionally, play sound effect on kill/death.

  1. Optional Enhancements:

- Leaderboard showing top killers or most heads. - Temporary buffs for killers (speed/strength) after a kill. - Rare events like “double life weekends” or “bonus heads”. - Trade system: players can exchange heads for Life Potions or special rewards.

  1. Compatibility:

- Must work for Minecraft Java Edition 1.21 (Spigot or Paper API recommended). - Use modern API methods for pop-ups, titles, action bars, and custom items.

Kodari AI
KodariMar 11 at 12:56 pm 22,070 (v2)

I’ll create a comprehensive HeadstealSMP plugin with lives system, head stealing, life potions, and all requested features.

HeadstealSMP
Lives-based survival plugin where players lose lives on death and can steal player heads. Features elimination mechanics, life potions with rare crafting recipes, scoreboard tracking, killer rewards with temporary buffs, and comprehensive stats tracking. Players start with 10 lives and can restore lives using craftable Life Potions. Includes elimination system, leaderboard, and configurable settings.

Plan

  • Lives system with persistent data storage and join pop-ups

  • Head drops on kill with automatic victim head creation

  • Life potion crafting with rare recipe and consumption mechanics

  • Scoreboard displaying lives and heads collected

  • Elimination system with titles and broadcasts

  • Killer rewards (speed/strength buffs)

  • Admin commands and leaderboard

All files created successfully! The HeadstealSMP plugin is now complete with:

Core Features Implemented:

  • Lives system (10 starting lives, configurable max)

  • Player head drops on kill with skull profiles

  • Life Potion crafting (Ghast Tear + Golden Apple + Nether Star)

  • Elimination mechanics with title displays and kick

  • Killer rewards (Speed + Strength buffs)

  • Scoreboard showing lives, heads, and kills

  • Leaderboard commands for top players

  • Admin commands for managing lives

  • Persistent data storage in YAML

  • Green particle effects on life potion consumption

  • Sound effects for kills, deaths, and eliminations

All XSeries patterns correctly implemented for cross-version compatibility (heads, sounds, particles, potions, materials).

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
19 1,208
src/main/java/com/headstealsmp/HeadstealSMP.java
package com.headstealsmp;

import com.headstealsmp.commands.*;
import com.headstealsmp.listeners.*;
import com.headstealsmp.managers.*;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class HeadstealSMP extends JavaPlugin {
    private ConfigManager configManager;
    private PlayerDataManager playerDataManager;
    private HeadManager headManager;
    private LifePotionManager lifePotionManager;
    private ScoreboardManager scoreboardManager;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.configManager = new ConfigManager(this);
        this.playerDataManager = new PlayerDataManager(this);
        this.headManager = new HeadManager(this);
        this.lifePotionManager = new LifePotionManager(this);
        this.scoreboardManager = new ScoreboardManager(this);
        
        registerListeners();
        registerCommands();
        
        getLogger().info("HeadstealSMP has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (playerDataManager != null) {
            playerDataManager.saveData();
        }
        
        getLogger().info("HeadstealSMP has been disabled!");
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        Bukkit.getPluginManager().registerEvents(new LifePotionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new CraftListener(this), this);
    }
    
    private void registerCommands() {
        getCommand("lives").setExecutor(new LivesCommand(this));
        getCommand("heads").setExecutor(new HeadsCommand(this));
        getCommand("headsteal").setExecutor(new HeadstealCommand(this));
        getCommand("leaderboard").setExecutor(new LeaderboardCommand(this));
    }
}