๐
1 file
16,318 chars
๐
pasted-code-1792444634694.txt
txt
316 lines
โถ
pasted-code-1792444634694.txt
txt
316 lines
# MASTER PROMPT โ CONVERT SPEAR SMP INTO MACE SMP
Act as an expert Minecraft Java plugin developer specializing in Paper 1.21.11, Java, Bukkit API, and custom PvP mechanics.
I have an existing Spear SMP plugin. I want you to **modify the existing plugin into a complete Mace SMP plugin**, removing all Spear SMP functionality and replacing it with the system specified below.
The final plugin must work on **Paper 1.21.11**, be suitable for a multiplayer survival server, and be ready to compile into a working `.jar` file.
## 1. Remove the Entire Spear SMP System
Completely remove all old Spear SMP features, including:
- All spear-related items, abilities, upgrades, and mechanics.
- All Spear SMP commands, subcommands, aliases, tab completions, and permissions that are no longer needed.
- All old spear kill-upgrade systems and configuration options.
- All spear-related messages, titles, action bars, scoreboards, recipes, and item metadata.
- All old Spear SMP plugin-specific item creation and event handlers.
- Any obsolete configuration files or classes that are no longer required.
Do not leave old Spear SMP commands or features accessible after conversion.
Keep unrelated server functionality intact. Do not delete other plugins or modify unrelated server files.
Rename the plugin appropriately to **MaceSMP** and update the plugin metadata, command registration, permissions, configuration, messages, and documentation.
If I provide the existing source code, inspect it first and modify it instead of creating an unrelated replacement plugin.
## 2. Starting Mace System
When a player first joins the server, give them one custom MaceSMP mace at Tier 1.
Requirements:
- The starting mace must have no enchantments.
- The mace must be unbreakable.
- The mace must have persistent custom metadata identifying it as a MaceSMP weapon.
- Store its tier in persistent item data so renaming it or moving it between inventory slots cannot change its tier.
- Prevent normal anvil operations, item merging, or other vanilla mechanics from removing its identity or changing its tier.
- Ensure the mace remains unbreakable through normal gameplay.
- Do not give duplicate starting maces to returning players.
- Provide configuration options to control whether the starting mace is automatically given to new players.
- Use safe inventory handling when the player's inventory is full.
Only authentic MaceSMP maces should trigger the tier-upgrade system. Ordinary vanilla maces must not be treated as MaceSMP weapons.
## 3. Mace Tier Progression
Create 10 tiers, from Tier 1 to Tier 10.
When a player kills another player using their authentic MaceSMP mace, the killer's mace upgrades by exactly one tier, provided kill progression has been unlocked and the mace is below Tier 10.
Requirements:
- Tier 1 โ Tier 2 โ Tier 3, continuing through Tier 10.
- One valid player kill equals one tier upgrade.
- Killing mobs must not upgrade the mace.
- Environmental deaths must not count as player kills.
- Deaths caused by another player without a qualifying MaceSMP mace must not upgrade the killer's mace.
- Do not allow repeated death-event processing to grant multiple upgrades for one death.
- Prevent self-kills and other invalid kills from granting progression.
- Do not upgrade beyond Tier 10.
- Preserve the mace's identity and unbreakable status through every upgrade.
- Update its name, lore, tier data, and enchantments immediately after upgrading.
- Provide configurable messages, sounds, particles, and visual effects for tier upgrades.
Make the rules configurable where practical.
## 4. Exact Tier Enchantment Progression
Implement the following default tier table. The enchantments listed are the target enchantments for that tier, not additional enchantments to stack on top of the previous tier.
| Tier | Density | Breach | Wind Burst | Additional Ability |
|---|---:|---:|---:|---|
| 1 | None | None | None | None |
| 2 | Density I | None | None | None |
| 3 | Density III | None | Wind Burst I | Air dash |
| 4 | Density IV | None | None | None |
| 5 | Density V | None | None | None |
| 6 | Density V | Breach I | None | None |
| 7 | Density V | Breach II | Wind Burst II | Shield stun |
| 8 | Density V | Breach III | None | None |
| 9 | Density V | Breach IV | None | None |
| 10 | Density VI | Breach V | Wind Burst III | Lightning strike and Tier 10 buffs |
Use the exact enchantment levels shown above.
If Paper 1.21.11 or the underlying Minecraft implementation does not permit an enchantment level through ordinary vanilla restrictions, implement the appropriate custom enchantment-level handling safely. Do not silently lower the specified enchantment levels.
Apply enchantments without duplicating old levels or accidentally stacking enchantments from previous tiers.
Keep all MaceSMP-specific enchantments and abilities separate from the normal enchantment system where necessary.
## 5. Tier 3 โ Air Dash
At Tier 3, the mace gains an air-dash ability.
Requirements:
- The player can activate the dash while airborne.
- Use a configurable key-independent activation method compatible with normal Paper plugins, such as right-clicking while holding the mace.
- Do not interfere with ordinary mace combat more than necessary.
- Launch the player forward in the direction they are looking, with configurable horizontal and vertical velocity.
- Add cooldown, configurable particles, and sound effects.
- Prevent accidental repeated activation from a single click.
- Handle low ceilings, walls, and other collision situations safely.
- Do not grant flight or permanent levitation.
Tier 3 must also grant **Speed I** while the player holds the authentic Tier 3 mace in their main hand.
## 6. Tier 7 โ Shield Stun
Tier 7 gains a custom shield-stun ability.
Requirements:
- When a Tier 7 or Tier 8/9/10 MaceSMP mace successfully hits a player actively blocking with a shield, disable that shield's blocking ability for a configurable duration.
- Use a configurable default stun duration, such as 3 seconds.
- Add a clear sound, particles, and an optional message when a shield is stunned.
- Prevent the stunned player from immediately restoring shield blocking during the stun.
- Restore normal shield functionality after the stun expires.
- Avoid permanently disabling shields or damaging unrelated inventory items.
- Make the ability configurable, including whether it applies only to Tier 7 and above.
- Handle logout, death, and plugin shutdown cleanly.
Tier 7 must also grant **Strength I** while the player holds the authentic Tier 7 mace in their main hand.
## 7. Tier 10 โ Unique Legendary Mace
Tier 10 is the strongest and rarest mace in the server.
### Global uniqueness
- Only one Tier 10 MaceSMP mace may exist on the server at any time.
- Store the current Tier 10 owner's UUID and the mace's unique ID in persistent plugin data.
- Enforce uniqueness across inventories, equipment, dropped items, player death drops, and reconnects.
- Prevent duplication through death events, inventory actions, commands, reloads, or plugin restarts.
- Do not create a second Tier 10 mace if the owner disconnects.
- Save the unique mace's state safely to disk.
### Transfer on death
If the Tier 10 owner is killed by another player:
1. Identify the actual killer reliably.
2. If the killer is carrying a lower-tier authentic MaceSMP mace, upgrade that mace to Tier 10 and transfer the legendary status to it.
3. If the killer does not have a MaceSMP mace, transfer the Tier 10 mace to the killer without creating a duplicate. Handle the killer's inventory and the victim's drops safely.
4. Remove or downgrade the dead owner's former Tier 10 mace as appropriate so only one Tier 10 mace exists.
5. Update the saved owner UUID and unique mace ID.
6. Announce the new owner to the entire server.
7. Save the result immediately so a restart cannot restore the previous owner incorrectly.
If the killer already owns the Tier 10 mace, do not create another one.
If the Tier 10 owner dies from the environment, mobs, or other non-player causes, do not transfer the legendary mace to an unrelated player. Implement a configurable recovery rule so the unique mace can be restored to its owner or recovered safely.
Handle disconnects, simultaneous deaths, and inventory overflow without losing or duplicating the unique mace.
### Tier 10 lightning ability
Whenever the Tier 10 mace successfully hits another player:
- Strike lightning at the target's location.
- Add configurable visual and sound effects.
- Make actual lightning damage configurable independently of the visual effect.
- Avoid causing unintended fire, environmental damage, or extra deaths unless enabled in configuration.
- Prevent the lightning event from being mistaken for a separate player kill and granting extra tier upgrades.
### Tier 10 passive effects
While the authentic Tier 10 mace is held in the player's main hand, grant:
- Strength II
- Speed II
- Resistance I
Requirements:
- Effects must refresh reliably while the mace is held.
- Remove the MaceSMP-granted effects when the player switches away from the mace, drops it, loses it, dies, or otherwise stops qualifying.
- Never permanently overwrite unrelated potion effects.
- Handle potion-effect cleanup safely.
- Ensure the passive effects cannot be duplicated or stacked through repeated refreshes.
## 8. Kill Upgrade Unlock Command
The tier-upgrade system must be disabled by default.
Create an administrative command:
`/macesmp unlock`
When executed by an authorized administrator, this command enables kill-based tier upgrading globally.
Requirements:
- Before unlocking, player kills must not upgrade any mace.
- After unlocking, the normal kill progression rules become active.
- Display a clear confirmation message.
- Save the unlocked state persistently so it survives server restarts.
- Provide a separate administrative command to lock progression again.
- Support status checking so administrators can see whether progression is enabled.
- Only authorized administrators may use these controls.
- Do not allow ordinary players to unlock progression.
## 9. Main Command System
Every MaceSMP command must begin with `/macesmp`.
Create the following command structure:
- `/macesmp help` โ display all available commands.
- `/macesmp unlock` โ enable tier upgrades on kills.
- `/macesmp lock` โ disable tier upgrades on kills.
- `/macesmp status` โ display the current global progression state and Tier 10 owner.
- `/macesmp give ` โ give a specified tier to a player, subject to uniqueness rules.
- `/macesmp set ` โ administratively set a player's authentic mace to a selected tier.
- `/macesmp reload` โ reload configurable settings safely without resetting saved player data.
- `/macesmp reset ` โ reset a player's mace progression, with confirmation or appropriate safeguards.
- `/macesmp config` โ display the available customization options and their values.
- `/macesmp config ` โ change supported configuration values where practical.
- `/macesmp recover` โ recover a missing unique Tier 10 mace safely.
- `/macesmp debug` โ show diagnostic information for administrators.
Implement permission checks, argument validation, tab completion, useful error messages, and console support where appropriate.
Only administrators should be allowed to run commands that alter game state or configuration.
Normal players should not be able to obtain higher-tier maces through commands.
Do not allow `/macesmp give` or `/macesmp set` to create multiple Tier 10 maces. If an administrator attempts to create a second Tier 10 mace, reject the action with a clear message unless the existing mace is safely transferred or recovered.
## 10. Configuration and Customization
Provide a clean `config.yml` with options for:
- Starting mace distribution.
- Starting tier.
- Whether kill progression starts locked.
- Tier upgrade rules.
- Enchantment levels for every tier.
- Air-dash velocity, cooldown, particles, and sounds.
- Shield-stun duration and effects.
- Tier 10 lightning visuals and damage.
- Tier 3, Tier 7, and Tier 10 potion effects.
- Mace names, lore, colors, and upgrade messages.
- Kill announcements and tier-upgrade broadcasts.
- Unique Tier 10 owner persistence and recovery behavior.
- Debug logging.
- Language and message customization.
- Permission nodes.
Do not hardcode values that should reasonably be configurable.
Validate configuration values and provide safe defaults if a setting is invalid.
## 11. Persistence and Security
Use reliable persistent storage for player progression, unlock state, and Tier 10 ownership.
Requirements:
- Save important state when it changes.
- Recover gracefully after unexpected restarts.
- Avoid race conditions in simultaneous kill events.
- Prevent item duplication through death drops, inventory movement, plugin reloads, or administrator commands.
- Use UUIDs rather than player names as permanent player identifiers.
- Ensure custom item identification cannot be forged simply by renaming an ordinary mace.
- Do not rely only on lore or display names to determine tier.
- Prevent event handlers from recursively triggering extra upgrades.
- Clean up temporary cooldowns, stun states, and passive effects.
- Keep the implementation compatible with Paper 1.21.11.
## 12. Technical Requirements
Use Java and the appropriate Paper API for the target version.
Deliver:
1. Complete Java source code.
2. `plugin.yml` with the correct name, main class, API version, commands, aliases if needed, and permissions.
3. `config.yml` with documented settings.
4. Any required data files or storage implementation.
5. A Maven `pom.xml` or Gradle build configuration.
6. Clear build instructions.
7. Installation instructions for a Paper 1.21.11 server.
8. A complete command and permissions reference.
9. A testing checklist covering every tier, ability, death-transfer scenario, uniqueness rule, restart, and locked progression.
10. A compiled plugin `.jar` if your environment supports building and attaching files.
Do not give me pseudocode, incomplete methods, placeholder implementations, or disconnected code snippets. Produce a complete, compilable project.
Before finalizing, check all imports, API calls, event priorities, enchantment handling, item metadata, command permissions, persistence logic, and compatibility with Paper 1.21.11.
If you cannot compile the plugin in your environment, state that honestly and provide the complete source and exact build instructions.
## 13. Acceptance Tests
The finished plugin must pass these tests:
1. A new player receives one unenchanted, unbreakable Tier 1 mace.
2. No mace upgrades from kills before `/macesmp unlock`.
3. After unlocking, one qualifying kill upgrades the killer's mace by exactly one tier.
4. Every tier receives the exact enchantments specified in the tier table.
5. Tier 3 has its air dash, Wind Burst I, Density III, and Speed I.
6. Tier 7 has shield stun, Wind Burst II, Density V, Breach II, and Strength I.
7. Tier 10 has Density VI, Breach V, Wind Burst III, lightning, Strength II, Speed II, and Resistance I.
8. All authentic MaceSMP maces remain unbreakable.
9. Death of a player carrying a lower-tier mace reduces that mace by two tiers, subject to the death rules below.
10. Death of the Tier 10 owner to another player transfers the single legendary mace correctly.
11. No normal gameplay or command can accidentally create a second Tier 10 mace.
12. Progression and ownership persist after a server restart.
13. All administrative commands are protected by permissions.
14. No Spear SMP commands, items, or abilities remain.
15. The plugin loads without errors on Paper 1.21.11.
First inspect the existing Spear SMP plugin and explain which files you will change. Then implement the complete MaceSMP conversion, build it if possible, and report any remaining limitations clearly.
KodariOct 19 at 9:27 pm 2
MaceSMP
MaceSMP is a feature-rich Paper 1.21.11 plugin that transforms the vanilla mace into a legendary tiered weapon system. Players receive an authentic unbreakable Tier 1 mace on first join; killing other players upgrades it in combat, unlocking 10 progressively stronger tiers with configurable enchantments like Density, Breach, and Wind Burst. Tier 3 grants an air-dash ability, Tier 7 stuns shields, and Tier 10 introduces a unique legendary mace with lightning strikes and passive Strength II, Speed II, and Resistance I. A global unlock system lets admins enable kill-based progression, while commands handle unlocking, tier management, configuration, recovery, and diagnostics. Persistent storage ensures ownership and progression survive restarts, with safeguards against duplication and forging.
Create the Paper 1.21.11 project, metadata, and configuration.
Implement persistent mace identity, tier progression, abilities, and Tier 10 uniqueness/recovery.
Add protected commands plus installation, permissions, and acceptance-test guidance.
Created a fresh MaceSMP project; there were no Spear SMP source files available to convert. It includes the Paper metadata, configuration, persistent mace identity and progression, abilities, admin commands, and README with permissions and an acceptance checklist.
Not verified: I havenโt compiled or runtime-tested the project, so no JAR is attached. To compile in Kodari, click Compile in the top bar (phone: โฎ โ Compile Project), click Compile in the window, then download the successful build.
Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
README.md
settings.gradle
Code
9 1,347
src/main/java/com/kodari/macesmp/MaceSMPPlugin.java
package com.kodari.macesmp;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
public final class MaceSMPPlugin extends JavaPlugin {
private MaceManager maceManager;
@Override
public void onEnable() {
saveDefaultConfig();
maceManager = new MaceManager(this);
maceManager.loadData();
Bukkit.getPluginManager().registerEvents(new MaceListener(this, maceManager), this);
MaceCommand command = new MaceCommand(this, maceManager);
getCommand("macesmp").setExecutor(command);
getCommand("macesmp").setTabCompleter(command);
Bukkit.getScheduler().runTaskTimer(this, maceManager::tickPassives, 20L, 20L);
Bukkit.getScheduler().runTaskTimer(this, maceManager::enforceLegendaryUniqueness, 100L, 100L);
}
@Override
public void onDisable() {
if (maceManager != null) {
maceManager.clearTemporaryEffects();
maceManager.saveData();
}
}
public MaceManager getMaceManager() {
return maceManager;
}
}