rkfxgt
๐Ÿ“Ž 1 file 5,267 chars
๐Ÿ“„
pasted-code-1782287475979.txt
txt 453 lines
โ–ถ
LostSMP Plugin Complete Feature Specification
Plugin Name

LostSMP

Version

Paper 1.21.11

Java Version

Java 21

Main Concept

LostSMP is a custom SMP plugin based on Hearts, Bounty Hunts, Eliminations, Revivals, and Risk vs Reward gameplay.

Players can gain hearts, lose hearts, hunt targets, revive dead players, craft hearts, and permanently increase or decrease their maximum health.

The entire SMP revolves around a configurable Bounty Day system controlled by admins.

Heart System

Every player has a custom heart count.

Default Hearts:
10

Minimum Hearts:
1

Maximum Hearts:
20

The plugin stores hearts separately from vanilla Minecraft health.

Whenever a player's heart count changes:

Max health updates automatically.
Health is synced instantly.
Data is saved automatically.

Example:

10 Hearts = 20 HP

15 Hearts = 30 HP

20 Hearts = 40 HP

Elimination System

If a player's hearts reach 0:

They are eliminated.
Switched to Spectator Mode.
An elimination message is broadcast.
Their Player Head drops.

Example:

"Gourav has been eliminated from Lost SMP!"

Heart Item

A custom Heart Item exists.

Properties:

Custom name
Custom lore
Custom model data support
Enchantment glow
PersistentDataContainer support
Stackable

When consumed:

+1 Heart

Cannot exceed 20 Hearts.

Heart Crafting Recipe

Recipe:

Top Row:
Obsidian | Obsidian | Obsidian

Middle Row:
Netherite Block | Totem of Undying | Netherite Block

Bottom Row:
Obsidian | Obsidian | Obsidian

Result:

1 Heart Item

Recipe can be enabled or disabled from config.yml.

Withdraw System

Command:

/lostwithdraw 

Example:

Player Hearts = 10

/lostwithdraw 1

Result:

Player Hearts = 9

Player receives:
1 Heart Item

Restrictions:

Cannot go below 1 Heart.
Invalid values blocked.
Messages configurable.
Bounty Day System

The plugin does NOT use a fixed 4-day cycle.

Instead, admins can choose the cycle length at any time.

Examples:

/lost time 3

/lost time 4

/lost time 6

/lost time 7

/lost time 10

Any value between 2 and 30 is allowed.

How Bounty Days Work

Example:

/lost time 3

Day 1 = Normal

Day 2 = Normal

Day 3 = Bounty Day

Repeat

Day 4 = Normal

Day 5 = Normal

Day 6 = Bounty Day

Repeat forever.

Example:

/lost time 6

Day 1 = Normal

Day 2 = Normal

Day 3 = Normal

Day 4 = Normal

Day 5 = Normal

Day 6 = Bounty Day

Repeat forever.

Bounty Day Start

When a Bounty Day begins:

Plugin selects 2 random online players.
Server starts voting.
Clickable voting messages appear in chat.
All players can vote.

Example:

Vote For Today's Target

[Steve]

[Alex]

The player with the highest votes becomes the Target.

Target System

After voting:

One player becomes:

TARGET

The second player becomes:

HUNTER

Both players are announced to the server.

Bounty Day Rules

Only during Bounty Day:

If Target kills Hunter:

Target gains 1 Heart

Hunter loses 1 Heart

If Hunter kills Target:

Hunter gains 1 Heart

Target loses 1 Heart

No heart transfers happen outside Bounty Day.

Normal PvP remains completely unchanged.

Bounty Day End

Bounty Day automatically ends at Minecraft Midnight.

When it ends:

Active Target removed
Active Hunter removed
Voting data cleared
Hunt data reset
Results broadcast
Admin Control Commands

Start Plugin:

/lost start

Starts the Lost SMP cycle immediately.

Resets day tracking.

Begins counting days from now.

Stop Plugin:

/lost stop

Stops all bounty cycle processing.

Reload Config:

/lost reload

Reloads configuration.

Cycle Length:

/lost time 

Examples:

/lost time 3

/lost time 5

/lost time 7

Changes how many days are required before the next Bounty Day.

Saves automatically.

Persists after restart.

Information Command

/lost info

Displays:

Current Day

Cycle Length

Days Remaining

Current Target

Current Hunter

Bounty Status

Next Bounty Day

Heart Commands

Permission:
lostsmp.admin

Set Hearts:

/lostheart set player|@a 

Add Hearts:

/lostheart add player|@a 

Remove Hearts:

/lostheart loss player|@a 

Check Hearts:

/lostheart get 

Supports:

@a selector
Offline players
Tab Completion
Revival System

When a player is eliminated:

A Player Head drops.

The head stores:

UUID
Name
Elimination data

The data survives restarts.

Revival Ritual

When the head is placed:

A revival ritual begins.

Duration:

2 Minutes

Server Broadcast:

Revival Started!

X: ___

Y: ___

Z: ___

During Ritual

Particle effects
Sounds
Countdown broadcasts
Progress tracking

Success

If head survives:

Player revived

Player returns to Survival Mode

Player receives:

1 Heart

Broadcast:

"Steve has been revived!"

Failure

If head breaks:

Ritual fails

Broadcast:

"Steve's revival ritual has failed!"

Heart Item Protection

Heart Items:

Cannot burn in lava.

Cannot burn in fire.

Cannot be destroyed by explosions.

Cannot be destroyed by TNT.

Cannot be destroyed by creepers.

Cannot despawn.

Cannot be destroyed by cactus.

Only the Void can destroy them.

Data Storage

Store:

Player Hearts

Eliminated Players

Current Cycle Day

Cycle Length

Current Target

Current Hunter

Vote Data

Revival Data

Plugin State

All data saved in YAML.

Automatic saving enabled.

Automatic loading enabled.

Data survives crashes and restarts
Kodari AI
KodariJun 24 at 7:55 am 30

Iโ€™ll create a comprehensive heart-based SMP plugin with bounty hunts, eliminations, and revival mechanics.

LostSMP
A custom SMP plugin featuring a dynamic heart-based survival system with configurable Bounty Days, player eliminations, revival rituals, and risk vs reward gameplay. Players can gain or lose hearts through combat, craft hearts, withdraw them as items, and participate in bounty hunts where targets and hunters compete for heart rewards. Includes admin controls, voting systems, and persistent data storage.

Complete LostSMP plugin created with all features:

Core Systems:

  • โค๏ธ Heart system (1-20 hearts, affects max health)

  • ๐Ÿ’€ Elimination (0 hearts = spectator mode + skull drop)

  • โญ Custom Heart item (craftable, consumable, protected)

  • ๐Ÿ’Ž Withdraw system (convert hearts to items)

Bounty Day System:

  • ๐Ÿ“… Configurable cycle (2-30 days, admin controlled)

  • ๐Ÿ—ณ๏ธ Clickable voting system for target selection

  • ๐ŸŽฏ Target vs Hunter mechanics with heart rewards

  • โฐ Auto-ends at midnight

Revival System:

  • ๐Ÿ’€ Place player skull to start 2-minute ritual

  • โœจ Particle effects and sounds during ritual

  • ๐Ÿ“ข Server-wide broadcasts with coordinates

  • โšก Revive with 1 heart on success

Commands:

  • /lost start|stop|reload|time|info - Admin cycle control

  • /lostheart set|add|loss|get - Manage hearts (@a support)

  • /lostwithdraw <amount> - Convert hearts to items

  • /vote <player> - Vote during Bounty Day

Protection:

  • Heart items immune to fire, lava, explosions, despawn

  • Data persistence across restarts

  • Automatic health syncing on join

rkfxgt

and add /help command for see all command

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
24 1,661
src/main/java/com/lostsmp/LostSMP.java
package com.lostsmp;

import com.lostsmp.command.*;
import com.lostsmp.item.HeartItem;
import com.lostsmp.listener.*;
import com.lostsmp.manager.*;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public class LostSMP extends JavaPlugin {
    private DataManager dataManager;
    private HeartManager heartManager;
    private VotingManager votingManager;
    private BountyManager bountyManager;
    private RevivalManager revivalManager;
    private HeartItem heartItem;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        dataManager = new DataManager(this);
        heartManager = new HeartManager(this, dataManager);
        votingManager = new VotingManager(this);
        bountyManager = new BountyManager(this, dataManager, votingManager, heartManager);
        revivalManager = new RevivalManager(this, heartManager);
        heartItem = new HeartItem(this);
        
        registerCommands();
        registerListeners();
        registerRecipes();
        
        if (dataManager.isPluginActive()) {
            bountyManager.start();
        }
        
        getLogger().info("LostSMP has been enabled!");
    }
    
    @Override
    public void onDisable() {
        if (bountyManager != null) {
            bountyManager.stop();
        }
        
        if (dataManager != null) {
            dataManager.save();
        }
        
        getLogger().info("LostSMP has been disabled!");
    }
    
    private void registerCommands() {
        getCommand("lost").setExecutor(new LostCommand(this, dataManager, bountyManager));
        getCommand("lost").setTabCompleter(new LostCommand(this, dataManager, bountyManager));
        
        getCommand("lostheart").setExecutor(new HeartCommand(heartManager));
        getCommand("lostheart").setTabCompleter(new HeartCommand(heartManager));
        
        getCommand("lostwithdraw").setExecutor(new WithdrawCommand(heartItem, heartManager));
        getCommand("lostwithdraw").setTabCompleter(new WithdrawCommand(heartItem, heartManager));
        
        VoteCommand voteCommand = new VoteCommand(votingManager);
        getCommand("vote").setExecutor(voteCommand);
    }
    
    private void registerListeners() {
        Bukkit.getPluginManager().registerEvents(new PlayerJoinListener(heartManager), this);
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(heartManager, bountyManager, revivalManager), this);
        Bukkit.getPluginManager().registerEvents(new HeartConsumeListener(this, heartItem, heartManager), this);
        Bukkit.getPluginManager().registerEvents(new ItemProtectionListener(heartItem), this);
        Bukkit.getPluginManager().registerEvents(new BlockPlaceListener(heartManager, revivalManager), this);
        Bukkit.getPluginManager().registerEvents(new BlockBreakListener(revivalManager), this);
    }
    
    private void registerRecipes() {
        CraftListener craftListener = new CraftListener(this, heartItem);
        craftListener.registerRecipe();
    }
}