๐
pasted-code-1788606622471.txt
txt
849 lines
โถ
Create a complete, professional, production-ready Minecraft core plugin for my server, **LegacySMP**.
This plugin should act as the main gameplay system of the server and combine:
* Complete Lifesteal system
* 6 unique Custom Items
* Custom Swords
* 2 Admin Swords
* Custom Maces
* Diamond Mace
* Admin Mace
* 2 complete Custom Armor Sets
* Full Set abilities
* Special server events
* Small Player transformation
* World Border progression
* Anti-Xray
* Anti-Freecam
* Anti-Exploit protection
* Staff tools
* Permissions
* Cooldowns
* Persistent data storage
* Professional configuration files
The plugin must be optimized for a modern **Paper Minecraft server** and built with clean, maintainable code.
---
# Lifesteal System
Every player starts with a configurable amount of hearts.
When a player kills another player:
* Killer gains 1 heart.
* Victim loses 1 heart.
* Heart gain/loss must be configurable.
* Maximum hearts must be configurable.
* Player data must be stored by UUID.
If a player reaches **0 hearts**:
* Immediately kick them.
* Permanently ban them from LegacySMP.
* Save that they were eliminated.
* Display a configurable elimination message.
Staff can revive players using:
`/ls revive `
Reviving should:
* Remove the Lifesteal ban.
* Remove eliminated status.
* Restore a configurable number of hearts.
All heart data must survive restarts, reconnects, reloads, and crashes.
---
# Custom Items
Create **6 unique Custom Items**.
Every item should have:
* Secure internal ID using PersistentDataContainer.
* Custom name.
* Lore.
* Material.
* Enchantments.
* Custom Model Data support.
* Unique ability.
* Cooldown.
* Sounds.
* Particles.
* Configurable values.
Each item must have a different gameplay purpose.
Do not identify custom items using only names or lore.
---
# Custom Swords
Add unique custom swords with:
* Custom damage.
* Custom enchantments.
* Unique abilities.
* Cooldowns.
* Particles.
* Sounds.
* Right-click / Shift-click abilities when appropriate.
---
# Admin Swords
Add **2 Admin Swords**.
Requirements:
* Staff-only.
* Permission checked every time an ability is used.
* Powerful unique abilities.
* Separate cooldowns.
* Custom particles and sounds.
Permission example:
`legacysmp.adminsword`
A normal player must not be able to use Admin Sword abilities even if they obtain the item.
---
# Custom Mace System
Add a complete **Custom Mace System**.
There must be a strict server-wide maximum of:
**3 obtainable Custom Maces in existence at the same time.**
This means the plugin must track every legitimate Custom Mace by a unique internal ID.
Do not only count maces currently held by online players.
The limit must account for maces stored in:
* Player inventories
* Ender Chests
* Chests
* Shulker Boxes where possible
* Dropped items
* Offline player data
* Other supported storage locations
The plugin should maintain its own registry/database of every generated Custom Mace.
Each mace receives a unique serial number.
Example:
`Legacy Mace #001`
`Legacy Mace #002`
`Legacy Mace #003`
Once all 3 legitimate maces exist, the plugin must refuse to create another one unless one is permanently removed by an administrator.
Add commands such as:
`/ls mace list`
Shows all registered maces and their owners/status.
`/ls mace give `
Creates a mace if the global limit allows it.
`/ls mace remove `
Permanently unregisters a mace.
`/ls mace info `
Displays detailed information about a registered mace.
Add protection against:
* Duplication
* Renaming
* NBT/PDC spoofing
* Giving duplicate serial numbers
* Server restart duplication
* Plugin reload duplication
---
# Diamond Mace
One of the three Custom Maces must be an extremely rare:
**Diamond Mace**
There can only be **ONE legitimate Diamond Mace** in the entire server at the same time.
The Diamond Mace should be one of the rarest and strongest obtainable items in LegacySMP.
It should have multiple abilities instead of only one.
Create several unique abilities for it.
Possible abilities:
### Diamond Slam
When the player performs a powerful mace hit or activates the ability:
* Create a shockwave.
* Damage nearby enemies.
* Apply configurable knockback.
* Play custom particles and sounds.
### Diamond Dash
Allow the owner to perform a short controlled dash.
Add:
* Cooldown
* Particles
* Sound
* Safe velocity handling
### Crystal Shield
Temporarily reduce incoming damage.
The duration and reduction percentage should be configurable.
### Ground Impact
When hitting the ground after falling:
* Create an impact effect.
* Affect enemies in a configurable radius.
* Deal damage based on configurable settings.
### Diamond Fury
Temporary combat mode that can grant configurable effects such as:
* Strength
* Speed
* Resistance
It must have a long cooldown to keep it balanced.
### Mace Passive
The Diamond Mace can also have a passive ability while held.
The passive should be configurable.
All Diamond Mace abilities must have:
* Independent cooldowns.
* Configurable damage.
* Configurable radius.
* Configurable duration.
* Configurable particles.
* Configurable sounds.
* ActionBar cooldown feedback.
The Diamond Mace must have its own unique internal identifier and serial number.
It must never be possible to have more than one legitimate Diamond Mace.
---
# Admin Mace
Create a separate:
**Admin Mace**
The Admin Mace is STAFF ONLY and is not part of the normal 3-mace player limit.
Only authorized staff should be able to use it.
Permission:
`legacysmp.adminmace`
Even if a normal player obtains it, none of its abilities should activate.
The Admin Mace should have several powerful staff abilities.
Examples:
* Powerful knockback strike.
* Staff shockwave.
* Launch target.
* Area knockback.
* Controlled lightning visual effect.
* Temporary staff combat mode.
All destructive or combat effects should be configurable.
The Admin Mace should clearly display:
`STAFF ONLY`
in its lore.
---
# Custom Armor
Create **2 complete Custom Armor Sets**.
Each includes:
* Helmet
* Chestplate
* Leggings
* Boots
Every piece needs:
* Internal ID
* Name
* Lore
* Enchantments
* Stats
* Effects
* Custom Model Data support
---
# Full Set Bonuses
When all four legitimate pieces of one matching set are equipped, activate its Full Set Bonus.
If even one piece is removed:
* Immediately disable the bonus.
Mixed armor sets must not activate a Full Set Bonus.
---
# Special Event System
Add a staff-controlled event.
Commands:
`/ls event start`
`/ls event stop`
`/ls event status`
The event only starts when staff chooses to start it.
When started:
* Broadcast configurable message.
* Display optional Title.
* Play configurable Sound.
* Enable event-specific abilities.
When stopped:
* Disable all event abilities.
* Reset affected players.
Permission:
`legacysmp.event.admin`
---
# Full Armor + Shift = Small Form
During the special event only:
If a player is wearing the complete required armor set, pressing:
**Shift / Sneak**
will toggle a special **Small Form**.
Small Form should change the player's actual supported scale attribute for the target Minecraft version.
It must not simply use a fake visual disguise.
The player must return to normal size if:
* Event stops.
* Armor piece is removed.
* Player dies.
* Player disconnects.
* Plugin disables/reloads.
* Administrator resets the event.
Add configurable:
* Small scale
* Cooldown
* Particles
* Sounds
* Messages
Example:
`small-scale: 0.5`
---
# World Border System
At the beginning of LegacySMP, staff should be able to activate a small starting border.
Command:
`/ls border start`
The starting Overworld size is configurable.
Example:
`starting-border-size: 500`
Add:
`/ls border center`
or:
`/ls border center `
to select the border center.
---
# Open Server Border
Command:
`/ls border open`
When executed:
### Overworld
Set the World Border to:
**10,000 blocks**
Default:
`open-overworld-border-size: 10000`
### Nether
Remove any restrictive border / set it effectively unrestricted.
### The End
Remove any restrictive border / set it effectively unrestricted.
One command should update all required worlds.
---
# Restore Starting Border
Add:
`/ls border restore`
This restores the original small starting border.
Also add:
`/ls border status`
to display:
* Current mode
* Overworld size
* Border center
* Starting/Open state
The border mode must survive restarts.
Use Paper/Bukkit's real WorldBorder API.
---
# Anti-Xray System
Add a strong server-side **Anti-Xray system**.
The plugin should work together with Paper's built-in Anti-Xray protections where supported instead of relying only on unreliable client-side detection.
Add detection for suspicious mining behavior.
Monitor patterns such as:
* Extremely high valuable-ore discovery rate.
* Repeated direct tunneling toward hidden ores.
* Suspicious ore sequences.
* Unusually efficient mining paths.
* Impossible or highly abnormal ore discovery patterns.
Do NOT instantly ban a player because of one suspicious block.
Use a violation/score system.
Example:
`Xray Violation Level: 1-100`
Suspicious behavior increases the score.
Normal gameplay and time can reduce it.
Threshold actions can include:
* Staff alert.
* Detailed log.
* Spectator review request.
* Configurable command.
* Optional configurable punishment.
Staff alert example:
`[LegacyAC] PlayerName may be using Xray. VL: 42`
Add:
`/ls anticheat xray `
to display:
* Current Xray VL.
* Valuable ores mined.
* Recent suspicious activity.
* Detection history.
Store logs for staff review.
---
# Paper Anti-Xray Integration
If Paper's built-in Anti-Xray is available, provide documentation/config recommendations or optional compatibility checks.
Do not disable Paper's native Anti-Xray protection.
The custom LegacySMP detection should act as an additional protection layer.
---
# Anti-Freecam System
Add an **Anti-Freecam module**.
The goal is to detect or limit suspicious behavior associated with Freecam mods without punishing legitimate players for normal camera movement, lag, spectator mode, or server mechanics.
The system should detect suspicious cases such as:
* Interaction with blocks that should not be reachable from the player's real server-side position.
* Attacking/interacting from impossible distances.
* Opening containers without legitimate reach or line of sight.
* Impossible block interaction angles.
* Suspicious interaction while the actual server-side player entity is elsewhere.
Validate important interactions using the player's real server-side location.
For sensitive interactions, check:
* Distance.
* Reach.
* Line of sight.
* Player state.
* World.
* GameMode.
* Teleport state.
If an interaction is impossible:
* Cancel it.
* Increase Anti-Freecam violation level.
* Alert staff if the threshold is reached.
Do not punish players only because their client camera moves.
Detect actual impossible server interactions instead.
---
# Anti-Freecam False Positive Protection
Ignore or handle correctly:
* Spectator mode.
* Admin vanish/spectator tools.
* Teleports.
* High ping.
* Respawn.
* World changes.
* Vehicles.
* Server-controlled movement.
Use configurable tolerances.
---
# Anti-Cheat Staff System
Add:
`/ls anticheat status `
`/ls anticheat xray `
`/ls anticheat freecam `
`/ls anticheat reset `
`/ls anticheat alerts`
Permission:
`legacysmp.anticheat.staff`
Staff should receive alerts only if they have the correct permission.
Add an option:
`staff-alerts: true`
---
# Anti-Cheat Logs
Store detections with:
* UUID
* Player name
* Detection type
* Violation level
* Date/time
* Location
* World
* Relevant detection details
Do not spam console with the same detection every tick.
Implement alert cooldowns.
---
# Staff Commands
Main command:
`/legacysmp`
Alias:
`/ls`
Include:
`/ls hearts `
`/ls hearts add `
`/ls hearts remove `
`/ls hearts set `
`/ls revive `
`/ls give - `
`/ls givearmor
`
`/ls mace give `
`/ls mace list`
`/ls mace info `
`/ls mace remove `
`/ls event start`
`/ls event stop`
`/ls event status`
`/ls border start`
`/ls border open`
`/ls border restore`
`/ls border status`
`/ls border center`
`/ls anticheat status `
`/ls anticheat xray `
`/ls anticheat freecam `
`/ls reload`
Add complete Tab Completion.
---
# Permissions
Add proper permissions:
`legacysmp.admin`
`legacysmp.reload`
`legacysmp.hearts`
`legacysmp.give`
`legacysmp.revive`
`legacysmp.adminsword`
`legacysmp.adminmace`
`legacysmp.mace.admin`
`legacysmp.event.admin`
`legacysmp.border.admin`
`legacysmp.anticheat.staff`
Make all permissions compatible with LuckPerms.
---
# Configuration Files
Use separate organized files:
`config.yml`
`messages.yml`
`items.yml`
`swords.yml`
`maces.yml`
`armor.yml`
`events.yml`
`border.yml`
`anticheat.yml`
Do not hardcode important values.
Everything important should be configurable.
---
# Data Storage
Prefer SQLite for persistent data.
Store:
* UUID
* Hearts
* Elimination state
* Custom mace registry
* Mace serial numbers
* Diamond Mace ownership/state
* Event state
* Border state
* Anti-cheat violation data
* Important persistent gameplay information
---
# Anti-Exploit Protection
Protect against:
* Duplicate hearts.
* Duplicate Custom Items.
* Custom Mace duplication.
* Diamond Mace duplication.
* Fake serial numbers.
* PDC spoofing.
* Ability spam.
* Cooldown bypass.
* Unauthorized Admin Item use.
* Armor-set spoofing.
* Small Form exploit.
* Border state reset.
* Heart values below 0.
* Hearts above maximum.
* Reconnect exploits.
* Respawn exploits.
---
# Professional Code Structure
Use separate managers/classes such as:
* LegacySMPPlugin
* LifestealManager
* HeartManager
* EliminationManager
* ReviveManager
* CustomItemManager
* SwordManager
* MaceManager
* MaceRegistry
* DiamondMaceManager
* AdminItemManager
* AbilityManager
* ArmorManager
* ArmorSetManager
* PlayerScaleManager
* EventManager
* WorldBorderManager
* CooldownManager
* AntiXrayManager
* AntiFreecamManager
* ViolationManager
* AntiCheatAlertManager
* DataManager
* MessageManager
* CommandManager
The finished result should feel like the **complete LegacySMP Core**, not a collection of basic systems thrown together.
Every major feature must be configurable, persistent, protected against exploits, and written so additional LegacySMP features can be added later without rewriting the entire plugin.
Core project: Gradle build, plugin metadata, organized configuration files, and persistent YAML storage.
Gameplay systems: lifesteal/elimination, custom items, swords, maces, armor sets, event transformation, and cooldowns.
Administration:
/lscommand tree, permissions, border controls, staff tools, and tab completion.Protection: freecam interaction validation, xray violation tracking, staff alerts, and persistent detection history.
Created the LegacySMP plugin foundation with:
Gradle/Paper 1.21.4 project setup and plugin metadata.
Persistent lifesteal data, heart management, elimination bans, revives, cooldowns, and configurable messages.
Custom item, armor, mace, event, scale, and world-border managers.
Three-mace registry with serial numbers, Diamond Mace uniqueness, and persistent tracking.
Anti-xray violation tracking, anti-freecam reach validation, staff alerts, and detection history.
/legacysmpand/lscommands with hearts, revive, item/armor giving, maces, events, borders, anticheat, reload, permissions, and tab completion.Separate configuration files for items, swords, maces, armor, events, borders, and anticheat.
๐
pasted-code-1788607680429.txt
txt
412 lines
โถ
Continue working on the **existing LegacySMP plugin**.
**DO NOT recreate the plugin from scratch.**
**DO NOT remove features that already work.**
First inspect the current project and fix the existing systems.
## 1. FIX THE STARTING WORLD BORDER
The border system currently works, but the starting border is wrong.
When we use:
`/ls border start`
the **Overworld border must become exactly 10x10 blocks**.
This is the tiny border we will use when the SMP first starts.
Default:
`starting-border-size: 10`
Make sure this means an actual Minecraft WorldBorder diameter of **10 blocks**, centered on the configured border center.
Keep these commands:
`/ls border start`
โ Overworld = 10x10
`/ls border open`
โ Overworld = 10,000 blocks
โ Nether = effectively no restrictive border
โ End = effectively no restrictive border
`/ls border restore`
โ Restore Overworld back to 10x10
`/ls border status`
โ Show current mode, size and center
Do NOT break the border system because it is already working. Only correct the starting size and make sure the state is saved after restarts.
---
# 2. FIX THE CUSTOM MACE SYSTEM
The Custom Maces currently **DO NOT WORK**.
Do not leave placeholder code.
Debug and fully implement the system.
There must be a maximum of:
**3 legitimate player Custom Maces in the entire server.**
The mace must actually be usable as a Minecraft Mace and its abilities must work.
Each Custom Mace needs:
* Real Mace material
* Unique PersistentDataContainer ID
* Unique serial number
* Custom name
* Lore
* Enchantments
* Abilities
* Cooldowns
* Sounds
* Particles
* Saved ownership/status
Example IDs:
`legacy_mace_001`
`legacy_mace_002`
`diamond_mace_001`
Make sure abilities are detected using PDC, NOT only item name or lore.
Commands must actually work:
`/ls mace give `
`/ls mace list`
`/ls mace info `
`/ls mace remove `
Add proper Tab Completion.
If a command fails, show a useful error instead of silently doing nothing.
---
# 3. DIAMOND MACE
One of the 3 player maces must be the unique:
**Diamond Mace**
There can only be **ONE Diamond Mace** in the server.
The Diamond Mace needs multiple REAL working abilities.
Add abilities such as:
### Diamond Slam
Create an area shockwave when activated.
### Diamond Dash
Launch the player forward in a controlled dash.
### Diamond Shield
Temporarily reduce incoming damage.
### Ground Impact
Create a powerful impact when the correct mace attack/activation happens.
### Diamond Fury
Temporarily give configurable combat buffs.
Every ability must have:
* Separate cooldown
* ActionBar cooldown
* Sound
* Particles
* Configurable damage
* Configurable radius
* Configurable strength
* Configurable duration
Do not only create the item visually.
**The abilities must actually function.**
---
# 4. ADMIN MACE
Also create a separate:
**Admin Mace**
The Admin Mace does NOT count toward the 3 normal maces.
Permission:
`legacysmp.adminmace`
It needs real working staff-only abilities.
If a player without permission receives the item, its special abilities must not work.
---
# 5. FIX THE ARMOR SYSTEM
The Custom Armor system currently **DOES NOT WORK CORRECTLY**.
The plugin currently only has a **helmet**.
That is incorrect.
Each Custom Armor Set must be a COMPLETE SET containing:
1. **Helmet**
2. **Chestplate**
3. **Leggings**
4. **Boots**
There are **2 complete armor sets**, meaning a total of:
**8 custom armor pieces.**
Do NOT generate only helmets.
Each set must contain:
`SET_1_HELMET`
`SET_1_CHESTPLATE`
`SET_1_LEGGINGS`
`SET_1_BOOTS`
and:
`SET_2_HELMET`
`SET_2_CHESTPLATE`
`SET_2_LEGGINGS`
`SET_2_BOOTS`
Every piece must have:
* Unique PDC ID
* Correct armor material
* Name
* Lore
* Enchantments
* Custom stats/effects
* Custom Model Data support if configured
* Set ID
* Armor slot ID
---
# 6. ARMOR GIVE COMMANDS
Make sure this works:
`/ls givearmor `
It must give the player ALL FOUR PIECES:
* Helmet
* Chestplate
* Leggings
* Boots
Also add individual piece support:
`/ls givearmor helmet`
`/ls givearmor chestplate`
`/ls givearmor leggings`
`/ls givearmor boots`
Add proper Tab Completion.
---
# 7. FULL SET DETECTION
Fix the Full Set system.
A player only counts as wearing a complete set when ALL of these are equipped:
* Correct Helmet
* Correct Chestplate
* Correct Leggings
* Correct Boots
All four pieces must:
* Belong to the same set
* Have valid LegacySMP PDC IDs
* Be equipped in the correct slots
Do not check only the helmet.
Do not activate the Full Set Bonus with 1, 2 or 3 pieces.
If one piece is removed:
**Immediately remove the Full Set Bonus.**
If armor from two different sets is mixed:
**Do not activate any Full Set Bonus.**
---
# 8. SHIFT SMALL-FORM ABILITY
Fix the special Event armor ability.
When the LegacySMP event is ACTIVE and a player is wearing ALL FOUR pieces of the required armor set:
**Pressing Shift/Sneak should toggle Small Form.**
Requirements:
* Event must be active
* Helmet equipped
* Chestplate equipped
* Leggings equipped
* Boots equipped
* All pieces from the same required custom set
* Every piece validated using PDC
Press Shift once:
โ Become small
Press Shift again:
โ Return to normal size
Use the correct Paper/Minecraft scale attribute supported by the target server version.
Example configurable value:
`small-scale: 0.5`
Automatically restore normal size when:
* One armor piece is removed
* Event stops
* Player dies
* Player disconnects
* Player changes world if required
* Plugin disables/reloads
* Admin stops the event
Never allow a player to remain permanently small because of a bug.
---
# 9. TEST ARMOR CHANGES CORRECTLY
The plugin must correctly detect armor changes caused by:
* Equipping normally
* Shift-clicking armor
* Dragging items
* Swapping armor
* Removing armor
* Armor breaking
* Death
* Respawn
* Inventory interactions
Do not rely only on one inventory click event if that causes the armor system to miss changes.
---
# 10. CONFIG FILES
Make sure the armor config includes all four pieces.
Example structure:
`armor.yml`
Set 1:
* helmet
* chestplate
* leggings
* boots
* full-set-bonus
* event-small-form
Set 2:
* helmet
* chestplate
* leggings
* boots
* full-set-bonus
* event-small-form
Make sure `maces.yml` includes all mace abilities and cooldowns.
Make sure `border.yml` defaults to:
`starting-border-size: 10`
`open-overworld-border-size: 10000`
---
# 11. DO NOT BREAK EXISTING FEATURES
Keep all existing working systems, including:
* Lifesteal
* 0 hearts elimination/ban
* Revive system
* Custom Items
* Custom Swords
* Admin Swords
* Event system
* World Border
* Anti-Xray
* Anti-Freecam
* Permissions
* Data saving
Only rewrite a system when necessary to fix it.
---
# 12. IMPORTANT โ ACTUALLY TEST THE IMPLEMENTATION
Before considering the task complete, verify:
* `/ls border start` creates a real 10x10 border.
* `/ls border open` changes Overworld to 10,000.
* `/ls border restore` returns it to 10x10.
* A Custom Mace can actually be given and used.
* Mace abilities actually trigger.
* Diamond Mace abilities actually work.
* Admin Mace permissions work.
* `/ls givearmor` gives Helmet + Chestplate + Leggings + Boots.
* Both armor sets contain all 4 pieces.
* Full Set Bonus requires all 4 pieces.
* Removing one piece disables the Full Set Bonus.
* Shift makes the player small only with the full required armor set and active event.
* Shift can restore normal size.
* Event stop always restores normal player size.
* Data still works after server restart.
Do not respond with only explanations or example snippets.
**Modify and complete the existing project so these features actually work.**
Fix and persist the world-border start/open/restore behavior.
Debug and complete the custom mace system, including Diamond and Admin Maces.
Replace the helmet-only armor implementation with two complete four-piece sets.
Fix armor commands, full-set detection, event small-form toggling, and armor-change handling.
Update configs and verify cross-file registration, persistence, permissions, and command completion.
Border: corrected the starting diameter to 10, added saved mode/center restoration on enable, and made status report mode, size, and center without a false update message.
Next: trace the existing mace item, persistence, command, and event flow before repairing it.
Maces: replaced the failed item creation path with real
MACEmaterial handling, added PDC identity/owner validation and persistent records, enforced the three-player/one-Diamond limits, completed commands/tab completion, and wired configurable slam, dash, shield, fury, and ground-impact abilities.Next: inspect the armor manager, event detection, configs, and scale/event lifecycle before replacing the helmet-only behavior.
Armor: made creation strict for all four slots with unique PDC IDs, added two explicit four-piece set definitions, made full-set bonuses require exact set/slot PDCs and remove when invalid, added four-piece/individual give behavior and tab completion, and wired delayed refreshes for inventory, drag, break, death, and respawn changes.
Final pass: inspect the build/API level and then tighten any compile-sensitive or lifecycle issues before finishing.
Implemented the existing LegacySMP systems without recreating the plugin.
World border
Starting border is now exactly 10 blocks.
/ls border startand/ls border restoreuse the configured center./ls border openuses a 10,000-block Overworld border and effectively unrestricted Nether/End borders.Border mode, size, and center persist through restarts.
/ls border statusnow reports mode, size, and center correctly.
Custom maces
Real Minecraft
MACEmaterial handling with fallback support.Persistent PDC marker, type, serial, and owner validation.
Maximum of three active player maces.
Exactly one active Diamond Mace.
Admin Maces are unlimited and excluded from the player limit.
Implemented persistent status tracking and inventory revocation on removal.
Completed
/ls mace give,list,info, andremovewith validation and tab completion.Added Diamond Slam, Dash, Shield, Fury, Ground Impact, configurable cooldowns, action bars, sounds, particles, damage, radius, strength, and duration.
Admin abilities require
legacysmp.adminmace.
Armor
Added complete TITAN and WRAITH sets with helmet, chestplate, leggings, and boots.
Added unique armor PDC IDs, set IDs, piece IDs, and slot IDs such as
SET_1_HELMET.Added enchantment and custom model data support.
Full-set detection now requires all four correctly equipped PDC-validated pieces from the same set.
Full-set bonuses are removed when any piece is missing or invalid.
/ls givearmor <player> <set>now gives all four pieces.Individual helmet, chestplate, leggings, and boots commands remain supported.
Added armor command validation and tab completion.
Small Form
Sneak now toggles small form only during the active event and with the complete required armor set.
Armor removal, inventory changes, dragging, breaking, death, respawn, disconnect, event stop, and plugin disable restore normal scale.
Armor refreshes are delayed one tick after inventory changes to catch shift-clicking, dragging, and swaps.
The changes are implemented in the existing project. A live Minecraft server was not available here for in-game command/event execution testing.
package com.legacysmp;
import java.io.File;
import java.util.HashMap;
import java.util.Map;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
public final class LegacySMPPlugin extends JavaPlugin {
private final Map<String, FileConfiguration> configurations = new HashMap<>();
private DataManager data;
private CooldownManager cooldowns;
private MessageManager messages;
private ItemManager items;
private ArmorManager armor;
private ScaleManager scale;
private LegacyEventManager eventManager;
private BorderManager border;
private MaceManager maces;
private LifestealManager lifesteal;
private AntiCheatManager antiCheat;
@Override
public void onEnable() {
saveDefaultConfig();
loadConfigurations();
data = new DataManager(this);
data.load();
cooldowns = new CooldownManager();
messages = new MessageManager(this);
lifesteal = new LifestealManager(this);
items = new ItemManager(this);
armor = new ArmorManager(this);
scale = new ScaleManager(this);
eventManager = new LegacyEventManager(this);
border = new BorderManager(this);
border.restoreSavedState();
maces = new MaceManager(this);
antiCheat = new AntiCheatManager(this);
GameplayListener gameplay = new GameplayListener(this);
Bukkit.getPluginManager().registerEvents(gameplay, this);
Bukkit.getPluginManager().registerEvents(antiCheat, this);
LegacyCommand command = new LegacyCommand(this);
getCommand("legacysmp").setExecutor(command);
getCommand("legacysmp").setTabCompleter(command);
Bukkit.getScheduler().runTaskTimer(this, armor::refreshOnlineBonuses, 20L, 40L);
Bukkit.getScheduler().runTaskTimer(this, () -> {
antiCheat.decayViolations();
data.save();
}, 20L * 60L, 20L * 60L);
}
@Override
public void onDisable() {
if (scale != null) scale.resetAll();
if (data != null) data.save();
}
private void loadConfigurations() {
String[] names = {"messages.yml", "items.yml", "swords.yml", "maces.yml", "armor.yml", "events.yml", "border.yml", "anticheat.yml"};
for (String name : names) {
File file = new File(getDataFolder(), name);
if (!file.exists()) saveResource(name, false);
configurations.put(name, YamlConfiguration.loadConfiguration(file));
}
}
public void reloadConfigurations() {
reloadConfig();
loadConfigurations();
messages = new MessageManager(this);
}
public FileConfiguration cfg(String name) { return configurations.get(name); }
public DataManager data() { return data; }
public CooldownManager cooldowns() { return cooldowns; }
public MessageManager messages() { return messages; }
public ItemManager items() { return items; }
public ArmorManager armor() { return armor; }
public ScaleManager scale() { return scale; }
public LegacyEventManager eventManager() { return eventManager; }
public BorderManager border() { return border; }
public MaceManager maces() { return maces; }
public LifestealManager lifesteal() { return lifesteal; }
public AntiCheatManager antiCheat() { return antiCheat; }
}