# MASTER PROMPT: Minecraft 26.2 Custom Legendary Items SMP Plugin
Act as a senior Minecraft Java server plugin developer. Build a complete, production-quality plugin inspired by the **legendary-item progression, unique abilities, cooldowns, and SMP combat mechanics** found in custom SMP servers.
## 1. Technical requirements
- **Minecraft:** Java Edition 26.2
- **Server software:** Paper
- **Language:** Java
- **Java version:** Use the version officially required by the selected Paper 26.2 build.
- **Build system:** Maven
- **Output:** A working, installable `.jar` plugin.
- **Plugin name:** `LegendaryItems`
- **Package:** `com.aimlessshubh.legendaryitems`
- **Author:** AimlesShubh
- **API compatibility:** Use the verified Paper 26.2 API and correct plugin metadata.
Before coding, verify the current Paper 26.2 API, Java requirements, dependency versions, and event methods. Do not use outdated API examples, fabricated methods, or deprecated functionality when a supported alternative exists.
## 2. Core item system
Create a configurable legendary-item system with the following features:
- Unique item names, descriptions, and rarity levels.
- Custom colors, lore, enchantment glint, and visual effects.
- Unique identifiers stored using PersistentDataContainer or the appropriate supported API.
- Distinct passive and active abilities for each item.
- Configurable ability cooldowns, durations, ranges, and effect strength.
- Item-specific crafting recipes and progression requirements.
- Persistent item identification after relogging, server restarts, or moving items between inventories.
- Support for an admin-defined maximum number of copies of each legendary item.
- Prevent ordinary renamed or forged items from activating special abilities.
- Make all item names, descriptions, recipes, and abilities configurable.
Use vanilla Minecraft items as the base items wherever possible. Do not require players to install a client-side mod.
## 3. Example legendary items
Create six original fantasy-themed items. Use these as initial examples, and make them fully configurable.
**A. Ember Relic**
- Theme: Fire and heat.
- Passive: Cosmetic ember particles.
- Active ability: A temporary fire-themed area effect.
- Cooldown: Configurable.
**B. Frost Relic**
- Theme: Ice and snow.
- Passive: Snowflake particles.
- Active ability: A temporary slowing field for eligible nearby mobs.
- Cooldown: Configurable.
**C. Wind Relic**
- Theme: Air and movement.
- Passive: Swirling wind particles.
- Active ability: A short mobility boost.
- Cooldown: Configurable.
**D. Earth Relic**
- Theme: Stone and defense.
- Passive: Earth-themed particles.
- Active ability: Temporary defensive resistance.
- Cooldown: Configurable.
**E. Void Relic**
- Theme: Cosmic magic.
- Passive: Purple particles.
- Active ability: A short-range teleport with safe-destination checks.
- Cooldown: Configurable.
**F. Celestial Relic**
- Theme: Light and support.
- Passive: Golden particles.
- Active ability: A temporary supportive effect for nearby players.
- Cooldown: Configurable.
These are example mechanics, not hard-coded limitations. Administrators must be able to change or disable abilities in the configuration.
## 4. Ability activation and effects
Implement a reusable ability framework that supports:
- Right-click activation.
- Sneak and right-click activation.
- Left-click activation where supported safely by the server API.
- Passive effects.
- Configurable cooldowns.
- Duration-based effects.
- Particle and sound feedback.
- Action-bar cooldown indicators.
- Permission checks and region restrictions.
- Cancellation when an ability cannot activate.
- Clean handling of player death, logout, world changes, and server shutdown.
Do not let abilities activate from ordinary items that merely share the same display name.
## 5. Commands and permissions
Implement the following commands:
- `/li help` — Show available commands.
- `/li list` — List configured legendary items.
- `/li give - ` — Give a configured item.
- `/li info
- ` — Display item information.
- `/li cooldown
- ` — Inspect cooldown information.
- `/li resetcooldown
- ` — Reset a cooldown.
- `/li reload` — Reload configuration safely.
- `/li recipe
- ` — Show crafting information.
Permissions:
- `legendaryitems.admin` — Administrative access.
- `legendaryitems.give` — Permission to give items.
- `legendaryitems.use` — Permission to activate abilities.
Register commands using the supported Paper 26.2 command system. Provide tab completion and useful error messages.
## 6. Crafting and progression
Create configurable crafting recipes for all six items.
Requirements:
- Recipes must be registered correctly and must not duplicate after configuration reloads.
- Ingredients and crafting patterns must be editable.
- Administrators can enable or disable individual recipes.
- Optional progression requirements should support advancements, collected materials, or configurable objectives.
- Prevent players from obtaining restricted items through unauthorized recipes.
- Ensure inventory space and ingredient consumption are handled correctly.
- Support configurable unique-item limits and ownership rules.
## 7. Configuration files
Generate complete example files:
- `config.yml` — General settings, cooldowns, restrictions, and ability balance.
- `items.yml` — Item definitions, lore, abilities, and rarity.
- `recipes.yml` — Crafting patterns and ingredients.
- `messages.yml` — All player-facing messages.
Validate configuration values and handle missing or invalid entries without crashing the server.
## 8. Performance, stability, and security
- Use event-driven logic instead of unnecessary repeating tasks.
- Avoid expensive scans of all entities or players every tick.
- Cancel scheduled tasks and clean up temporary state appropriately.
- Prevent cooldown bypasses through relogging or reconnecting.
- Prevent item duplication and unintended crafting exploits.
- Respect PvP settings, world restrictions, and protection plugins where integration is supported.
- Never modify player data or worlds unexpectedly.
- Log actionable errors without flooding the console.
- Keep the code modular, documented, and easy to extend.
## 9. Project structure
Organize the project into separate classes for:
- Main plugin lifecycle.
- Item definitions and item creation.
- Item identification and validation.
- Ability registration and execution.
- Cooldown management.
- Recipe management.
- Commands and tab completion.
- Configuration loading and validation.
- Player lifecycle and cleanup.
- Messages and utility methods.
Use clear interfaces and avoid placing the entire plugin in one Java class.
## 10. Testing and build requirements
Create automated tests for the components that can be tested independently.
Verify:
1. The project compiles against the actual Paper 26.2 API.
2. The generated JAR has the correct plugin metadata.
3. All configuration files are included.
4. Every registered item can be created and identified.
5. Cooldowns behave correctly.
6. Recipes register and reload without duplication.
7. Invalid commands return helpful messages.
8. Items retain their identity after relogging and restarting.
9. Invalid configuration values are handled safely.
10. The plugin loads successfully on a clean Paper 26.2 test server.
Run the build and tests if the environment permits. Do not claim tests passed unless they were actually executed.
## 11. Required deliverables
Provide:
1. The complete Maven project.
2. Every required Java source file.
3. `pom.xml` and plugin metadata.
4. All example configuration files.
5. Automated tests where practical.
6. Exact build commands.
7. Installation instructions.
8. Example commands for administrators.
9. A troubleshooting guide.
10. The final compiled `.jar`, if compilation is available.
Do not provide pseudocode, missing classes, placeholder methods, or unexplained TODOs as the finished implementation. If a requirement cannot be implemented with the verified API, explain the limitation and provide a working alternative.
**Start by checking the Paper 26.2 development requirements, then create the project structure, implement the complete plugin, compile it, and report the actual test results.**