ArielDEV
πŸ“Ž 1 file 11,135 chars
πŸ“„
legacysmp-kodari-prompt.md
md 116 lines
β–Ά
# LegacySMP Plugin β€” Fix & Complete (Paper/Bukkit)

You are working on an **existing Minecraft Paper plugin called LegacySMP**. Your job is to **inspect the current project source code first**, then fix, complete, and improve it β€” not recreate it from scratch.

## Ground Rules (do not violate)
- Inspect the existing code before changing anything. Preserve every feature that already works.
- Fix broken systems; do not rewrite unrelated working systems (e.g. the World Border system already works β€” only adjust the specific behaviors listed below).
- No TODOs, placeholders, pseudo-code, unfinished classes, or commands that do nothing. Every feature must actually function in-game.
- Keep the project compiling at every stage. Use modern Paper/Bukkit APIs for the project's MC version.
- Persist all important data (SQLite preferred) keyed by **player UUID**, never username.
- Do NOT add any Anti-Cheat, Anti-Xray, or Anti-Freecam system, or general movement/killaura detection. Only anti-exploit protections for LegacySMP's own custom systems (dupes, cooldown bypass, permission bypass, etc).
- Use a clean modular class structure (see "Code Structure" below) β€” no single giant class.
- Do not finish with just a written summary β€” implement directly in the project files, then verify against the checklist at the end.

## Top-Priority Fixes (things currently broken)
1. Custom Maces don't work β€” fix completely, must be real Minecraft Mace items with working abilities.
2. Custom Armor is incomplete (Helmet only) β€” must have 2 full sets (Helmet/Chestplate/Leggings/Boots = 8 pieces).
3. Starting World Border must be exactly 10x10 blocks.
4. Normal death must respawn the player at their exact death location (not world/bed spawn).
5. Exactly 3 collectible player Maces total: 1 Diamond + 2 Regular. The Admin Mace is separate and NEVER counts toward this limit.
6. Diamond Mace needs multiple real working abilities, each with its own cooldown.
7. Full Armor Set + Shift = Small Form, only during a Staff-controlled Event.

---

## 1. Lifesteal System
- Configurable: starting hearts, max hearts, hearts gained per kill, hearts lost per death, hearts restored on revive.
- On kill: killer +1 heart (configurable), victim -1 heart (configurable). Update actual max health correctly.
- Store by UUID. Persist through disconnect/reconnect/restart/reload/crash.
- Prevent: duplicate heart rewards/losses per kill/death, values going below 0 or above max, respawn/reconnect exploits.

## 2. Elimination at 0 Hearts
- At exactly 0 hearts: kick, permanently ban, save eliminated state, show configurable elimination message.
- Eliminated state and ban must survive restart; player can't reconnect until revived.

## 3. Revive System
- `/ls revive ` β€” removes ban + eliminated status, restores configurable hearts, works for offline players.

## 4. Death Location Respawn
- Real death occurs, but player respawns at the exact world/X/Y/Z/yaw/pitch of death β€” never world/bed/anchor spawn.
- If death drops hearts to 0, elimination/ban takes priority over the respawn-restore.

## 5. Six Custom Items
- Each: secure PDC identifier (never identify by name/lore alone), custom name/lore, correct material, enchantments, Custom Model Data support, unique ability, cooldown, particles, sounds, configurable values.
- 6 distinct mechanics (e.g. dash, shockwave, knockback, temp strength/speed, resistance, shield, area attack, PvP debuff, escape) β€” no duplicated mechanics.

## 6. Custom Swords
- Each: unique PDC ID, name, lore, damage, enchantments, ability (right/left click, shift+right click, or attack trigger β€” must not trigger accidentally), cooldown, particles, sounds.

## 7. Two Admin Swords
- Staff-only, permission `legacysmp.adminsword` checked on every activation.
- If a normal player somehow has one, the special ability must not work.
- Unique PDC ID, unique ability, strong configurable effects, cooldown, sounds, particles, staff-only lore.

## 8–19. Custom Mace System (critical fix)
- Real Minecraft Mace items with working custom abilities.
- Exactly 3 collectible/player Maces total: 1 Diamond Mace max, 2 Regular Custom Maces max. Admin Mace is separate and excluded from this count entirely.
- **Mace Registry**: persistent (SQLite), each Mace has unique PDC ID, unique serial number, type, creation record, status, owner (if any). Registry is the source of truth (not inventory scanning); must track Maces in inventory, ender chest, containers, shulkers, dropped, or owned by offline players. Survives restart.
- **Duplication protection**: reject creation past limits, no duplicate serials/records, no dupes via restart/reload/renaming.
- **Commands**: `/ls mace give  diamond|regular|admin` (enforcing limits, admin excluded from count), `/ls mace list`, `/ls mace info `, `/ls mace remove ` β€” with tab completion and clear success/error messages.
- **Diamond Mace abilities** (each with independent cooldown, configurable values, particles/sounds, ActionBar cooldown feedback):
  - Diamond Slam: area shockwave, damage, knockback, radius, particles, sound.
  - Diamond Dash: controlled forward launch, safe velocity, configurable distance/velocity.
  - Diamond Shield: temporary damage reduction, duration.
  - Ground Impact: on landing, area damage + knockback, radius.
  - Diamond Fury: temporary strength/speed/resistance combat mode, longer cooldown.
  - Passive effect while held (configurable).
- **Admin Mace**: permission `legacysmp.adminmace`; abilities don't activate for non-staff; lore contains "STAFF ONLY"; unique powerful abilities (staff shockwave, strong knockback, target launch, area knockback, lightning visual, temp combat mode); fully excluded from all Mace count/registry limits.

## 20–27. Custom Armor (critical fix)
- 2 complete sets (SET_1 and SET_2), each with Helmet/Chestplate/Leggings/Boots = 8 pieces total.
- Each piece: unique PDC ID, set ID, slot ID, correct material, name, lore, enchantments, stats/effects, Custom Model Data support. Never identify by name alone.
- `/ls givearmor  ` gives all 4 pieces; `/ls givearmor   ` gives one. Tab completion.
- **Full Set Bonus**: only activates with all 4 correct pieces (same set, correct slots, PDC-validated). Removing any piece removes the bonus immediately. Mixed sets never trigger a bonus. Each set has a distinct bonus (speed/strength/resistance/regen/extra health/damage reduction/special ability).
- Detect armor changes via equip, shift-click, inventory click, drag, swap, removal, breaking, death, respawn β€” use multiple events/checks so nothing is missed.

## 28–30. Staff-Controlled Event + Small Form
- `/ls event start|stop|status`, permission `legacysmp.event.admin`. Start: broadcast + optional title/subtitle + sound + enable event-only mechanics. Stop: disable mechanics, restore affected players, broadcast ending message. Never auto-starts.
- During Event only: full correct 4-piece armor set + Shift toggles Small Form (normal↔small) using the proper Paper scaling attribute. Configurable scale (e.g. `small-scale: 0.5`), cooldown, sound, particles, messages.
- Always reset to normal size on: event stop, armor piece removed, death, disconnect, world change (if required), plugin reload/disable, staff stop β€” never leave a player stuck small.

## 31–36. World Border (fix only the specified behavior β€” don't rewrite the working system)
- `/ls border start`: Overworld border = exactly 10x10 (`starting-border-size: 10`), using real WorldBorder API.
- `/ls border center [x z]`: set/persist center (defaults to Staff's position).
- `/ls border open`: Overworld = 10,000 (`open-overworld-border-size: 10000`); Nether and End get no restrictive border. One command updates all worlds.
- `/ls border restore`: back to 10x10. `/ls border status`: shows mode, size, center, state.
- Border state persists through restart (STARTING stays STARTING, OPEN stays OPEN).
- Configurable broadcasts/titles/subtitles/sounds for start/open/restore.

## 37–38. Ability & Cooldown System
- Centralized ability system supporting right/left click, shift, shift+right click, attack, mace interactions, armor conditions, event conditions β€” each with configurable damage/radius/duration/strength/knockback/cooldown/particles/sounds/messages.
- Centralized `CooldownManager` tracked per Player+Ability (independent per ability β€” using one ability must not cooldown another). ActionBar feedback showing remaining time or "ready".

## 39–40. Commands & Permissions
Main command `/legacysmp` (alias `/ls`) with subcommands: `hearts [|add|remove|set]`, `revive`, `give`, `givearmor`, `mace [give|list|info|remove]`, `event [start|stop|status]`, `border [start|open|restore|status|center]`, `reload`. Full tab completion, clear success/error messages (never silent failure).

Permissions (LuckPerms-compatible): `legacysmp.admin`, `.reload`, `.hearts`, `.give`, `.revive`, `.adminsword`, `.adminmace`, `.mace.admin`, `.event.admin`, `.border.admin`.

## 41–43. Config & Data
Split config across `config.yml`, `messages.yml`, `items.yml`, `swords.yml`, `maces.yml`, `armor.yml`, `events.yml`, `border.yml` β€” no hardcoded gameplay values. Use SQLite for player hearts/eliminated state, Mace registry, event state, border state β€” keyed by UUID.

## Code Structure (suggested classes)
`LegacySMPPlugin`, `LifestealManager`, `HeartManager`, `EliminationManager`, `ReviveManager`, `DeathLocationManager`, `CustomItemManager`, `SwordManager`, `AdminItemManager`, `MaceManager`, `MaceRegistry`, `DiamondMaceManager`, `AbilityManager`, `CooldownManager`, `ArmorManager`, `ArmorSetManager`, `PlayerScaleManager`, `EventManager`, `WorldBorderManager`, `DataManager`, `MessageManager`, `CommandManager`.

## Final Verification Checklist (confirm each before declaring done)
- Lifesteal correctly adjusts hearts both ways; max/min enforced.
- 0 hearts β†’ permanent elimination/ban that survives restart; `/ls revive` fully works.
- Death respawn lands exactly at death coordinates; elimination still takes priority at 0 hearts.
- All 6 custom items, all custom swords, and both Admin Swords function correctly with permission checks.
- Maces: exactly 1 Diamond + 2 Regular possible (never more), Admin Mace fully excluded from that count and permission-gated; all 5 Diamond abilities (Slam/Dash/Shield/Ground Impact/Fury) work with independent cooldowns; registry persists and blocks duplication.
- 8 armor pieces across 2 full sets exist; `/ls givearmor` works fully and per-piece; Full Set Bonus only with all 4 correct matching pieces, breaks immediately on removal or mixing.
- Event start/stop/status work; Small Form only triggers with full correct armor during an active event, toggles on Shift, and always resets on every listed condition.
- Border start = 10x10, open = 10000 (Nether/End unrestricted), restore = 10x10, status accurate, state survives restart.
- All commands have tab completion and never fail silently; all permissions function; all data survives restart/reload.
- No anti-cheat/anti-xray/anti-freecam/movement-detection code has been added anywhere.
Kodari AI
KodariSep 5 at 1:30 pm 4
LegacySMPComplete
A comprehensive Minecraft Paper plugin implementing a lifesteal system with persistent hearts, elimination at zero hearts, and revival commands. Features six custom items, custom swords, two admin swords, and a complete mace system with exactly one diamond and two regular maces tracked in a persistent SQLite registry with duplication protection. Includes two full custom armor sets with PDC-validated set bonuses, a staff-controlled event system with shift-activated small form scaling, and a world border manager starting at exactly 10x10 blocks. All systems use centralized ability and cooldown managers with ActionBar feedback, split configuration files, and UUID-keyed SQLite persistence.
  1. Create the Gradle/Paper project and split YAML configuration.

  2. Add persistent SQLite data, lifesteal/elimination/respawn handling, and command routing.

  3. Implement custom items, swords, permission-gated admin items, mace registry/abilities, and cooldowns.

  4. Implement both armor sets, event-only small form, and persistent world-border modes.

  5. Register listeners, tab completion, scheduled passive effects, and lifecycle cleanup.

Implemented the LegacySMP plugin from scratch with:

  • Paper 1.21.4 Gradle project, SQLite persistence, Lombok, XSeries, and split YAML configuration.

  • UUID-based lifesteal, heart limits, elimination bans, revive support, and exact death-location respawning.

  • Six custom items, four custom swords, two permission-gated admin swords, PDC identifiers, enchantments, cooldowns, particles, and sounds.

  • Persistent mace registry with limits of 1 Diamond and 2 Regular maces, separate admin maces, serials, status tracking, removal, and abilities.

  • Two complete armor sets with PDC validation, set bonuses, equip-change handling, and event-only Small Form scaling.

  • Staff-controlled event commands with persistent state and cleanup on death, disconnect, world change, reload, and disable.

  • Persistent world-border modes: 10x10 starting/restored border and 10000x10000 overworld open mode.

  • /ls command routing, permissions, subcommands, and tab completion.

ArielDEV
πŸ“Ž 1 file 3,677 chars
πŸ“„
legacysmp-hearts-kodari-prompt.md
md 65 lines
β–Ά
# LegacySMP β€” Lifesteal Hearts & Elimination System

You are working on an **existing Minecraft Paper plugin called LegacySMP**. Inspect the current project source code first, then implement/fix the following feature inside the existing project. Do not recreate the plugin from scratch, do not touch unrelated systems, and do not leave placeholders β€” every part of this must actually function in-game.

## Feature: Lifesteal Hearts

**When Player A kills Player B in PvP:**
- Player A (the killer) gains **1 heart** (configurable amount).
- Player B (the victim) loses **1 heart** (configurable amount).
- Only real player-vs-player kills trigger this β€” deaths from mobs, fall damage, lava, etc. must NOT change hearts.
- This must update the player's actual max health attribute (1 heart = 2 HP), not just an internal number β€” and clamp current health down if it now exceeds the new max.

**Configurable values (add to config.yml, do not hardcode):**
- Starting hearts for new players
- Maximum hearts a player can ever reach
- Hearts gained per kill
- Hearts lost per death
- Hearts restored on revive

**Storage:**
- Store hearts by the player's **UUID**, never by username.
- Persist through disconnect, reconnect, server restart, plugin reload, and server crash.

**Anti-exploit requirements:**
- A single kill must never grant more than one heart reward (no double-counting from multiple events firing).
- A single death must never cause more than one heart loss.
- Hearts must never go below 0 or above the configured maximum.
- Guard against respawn exploits and reconnect exploits that could bypass these rules.
- An already-eliminated player must not be able to gain hearts.

## Feature: Zero Hearts = Elimination

When a player's hearts reach exactly **0**:
- Kick the player immediately.
- Permanently ban them (must work whether they are online or offline at the time).
- Save their "eliminated" state persistently (UUID-based), so it survives a server restart.
- Show a configurable elimination/ban message, e.g.:
  `"You lost all of your hearts and were eliminated from LegacySMP!"`
- An eliminated player must not be able to reconnect until revived by staff.
- This elimination check must never fire twice for the same 0-heart event (no double ban attempts).

## Feature: Revive System

Implement `/ls revive ` for staff:
- Removes the player's Lifesteal ban.
- Removes their eliminated status.
- Restores a configurable amount of hearts.
- Must work for **offline players** (staff can revive someone who isn't online).
- Permission: `legacysmp.revive`.

## Implementation notes
- Use a clean, dedicated class (e.g. `HeartManager`) rather than cramming this into an existing large/unrelated class β€” but wire it into the existing plugin structure and command system rather than creating a parallel plugin.
- Use the real Bukkit/Paper attribute API for max health and the real Paper ban API (by player profile/UUID) for the ban β€” not a fake or cosmetic restriction.
- Keep everything else in the project working exactly as it currently does.

## Verify before finishing
1. Killing a player grants exactly 1 configurable heart to the killer.
2. Dying to a player removes exactly 1 configurable heart from the victim.
3. Non-PvP deaths do not change hearts.
4. Hearts never exceed the configured maximum or drop below 0.
5. Reaching 0 hearts kicks and permanently bans the player, online or offline.
6. Eliminated status and the ban survive a server restart.
7. `/ls revive ` works even when the target is offline, and restores the configured revive amount.
8. No duplicate heart rewards/losses or duplicate bans can occur from a single kill/death.
Kodari AI
KodariSep 5 at 2:06 pm 3
  1. Inspect the existing plugin structure, command system, persistence, and player-death flow.

  2. Add a UUID-backed HeartManager with configurable lifesteal, elimination, ban, respawn, and revive handling.

  3. Wire /ls revive <player> into the existing command and register the required listeners.

  4. Extend configuration and verify all referenced APIs and integration points.

Implemented the Lifesteal Hearts system in LifestealManager.

  • Uses UUID-backed SQLite persistence and clamps hearts between 0 and max-hearts.

  • Rewards and losses occur only for player kills.

  • Prevents duplicate processing using persistent death-location state plus runtime guards.

  • Updates the real max_health attribute and clamps current health.

  • Eliminated players are persistently marked, profile-banned through Paper’s ProfileBanList, and kicked.

  • Reconnects are denied through PlayerLoginEvent.

  • /ls revive <player> works offline and pardons by player profile/UUID.

  • Eliminated players cannot receive further heart rewards.

  • Existing configuration values and legacysmp.revive permission were already present and are used.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
settings.gradle
Code
30 1,096
src/main/java/com/legacysmp/LegacySMPPlugin.java
package com.legacysmp;

import com.legacysmp.data.DataManager;
import com.legacysmp.util.CooldownManager;
import com.legacysmp.util.MessageManager;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;

import java.io.File;

public class LegacySMPPlugin extends JavaPlugin {
    private DataManager dataManager; private MessageManager messages; private CooldownManager cooldowns; private LifestealManager lifesteal; private CustomItemManager customItems; private SwordManager swords; private MaceManager maces; private ArmorManager armor; private PlayerScaleManager scales; private EventManager events; private WorldBorderManager borders;
    @Override public void onEnable(){saveDefaultConfig();for(String file:new String[]{"messages.yml","items.yml","swords.yml","maces.yml","armor.yml","events.yml","border.yml"})saveResource(file,false);dataManager=new DataManager(this);try{dataManager.open();}catch(Exception exception){getLogger().severe("SQLite could not be opened: "+exception.getMessage());getServer().getPluginManager().disablePlugin(this);return;}messages=new MessageManager(this);cooldowns=new CooldownManager();lifesteal=new LifestealManager(this,dataManager,messages);customItems=new CustomItemManager(this,cooldowns,messages);swords=new SwordManager(this,cooldowns,messages);maces=new MaceManager(this,dataManager,cooldowns,messages);armor=new ArmorManager(this,messages);scales=new PlayerScaleManager(this);events=new EventManager(this,armor,scales,cooldowns,messages);borders=new WorldBorderManager(this,messages);LegacyListener listener=new LegacyListener(this);Bukkit.getPluginManager().registerEvents(listener,this);CommandManager commandManager=new CommandManager(this,messages);if(getCommand("legacysmp")!=null){getCommand("legacysmp").setExecutor(commandManager);getCommand("legacysmp").setTabCompleter(commandManager);}getServer().getScheduler().runTaskTimer(this,maces::runPassive,40,40);if(borders.status().equals("STARTING"))borders.start();else borders.open();}
    @Override public void onDisable(){if(events!=null)events.resetAll();if(dataManager!=null)dataManager.close();}
    public FileConfiguration loadConfiguration(String name){File file=new File(getDataFolder(),name);if(!file.exists())saveResource(name,false);return YamlConfiguration.loadConfiguration(file);}
    public void reloadAll(){events.resetAll();reloadConfig();messages.reload();customItems.reload();swords.reload();maces.reload();armor.reload();events.reload();borders.reload();}
    public DataManager getDataManager(){return dataManager;} public MessageManager getMessages(){return messages;} public CooldownManager getCooldowns(){return cooldowns;} public LifestealManager getLifesteal(){return lifesteal;} public CustomItemManager getCustomItems(){return customItems;} public SwordManager getSwords(){return swords;} public MaceManager getMaces(){return maces;} public ArmorManager getArmor(){return armor;} public EventManager getEvents(){return events;} public WorldBorderManager getBorders(){return borders;}
}