๐
1 file
2,803 chars
๐
pasted-code-1767845685079.txt
txt
195 lines
โถ
pasted-code-1767845685079.txt
txt
195 lines
Create a production-ready, advanced, and highly customizable Minecraft plugin with the following strict requirements and constraints.
๐ง Core Environment
Minecraft Version: Paper 1.21.8
Java Version: Java 21
IDE: IntelliJ IDEA
Base Package: com.mrsilent
Plugin Type: Paper API plugin (no Spigot-only hacks)
Performance Target: Stable for 2,000+ concurrent players
๐ฏ Primary Goal
Display item sell prices in the item lore ONLY when hovering (tooltip-based display).
The actual item must never be modified or permanently edited.
No fake items, no inventory rewriting, no duplication risk.
๐ฐ Price Sources (Priority Order)
BuffItem plugin
Used for custom items
Detect BuffItem identifiers correctly
fallback_price.yml
Used for vanilla / normal items
Material-based pricing
Safe fallback to 0 if no price exists
๐งพ Lore Display Rules
Single item: show individual sell price
Stacked items: show total stack worth
Shulker boxes:
Recursively calculate total value of all contents
Configurable recursion depth limit
Tooltip must update dynamically on hover
No duplication or desync issues
โ๏ธ Configuration (Highly Customizable)
Everything must be configurable via YAML:
Lore format templates
{worth} โ single item price
{total_worth} โ stack price
Optional hover delay
Rarity-based color coding
Per-item-type toggles:
Enable/disable for:
Tools
Armor
Consumables
Shulker boxes
Inventory-type filters (player inventory, chest, merchant, etc.)
Toggle per-player visibility
โก Performance & Optimization (Critical)
NO polling loops
NO per-tick inventory scans
Use:
Async price caching
Batched calculations
Smart invalidation
Update lore only on:
Hover events
Inventory open/close
Item pickup
Must not cause TPS drops on large servers
๐งฉ Technical Requirements
Tooltip-only display (hover-based)
Cursor-item tooltip support
ProtocolLib-based packet handling (preferred)
No fake ItemStacks
Safe handling of:
Shift-click
Drag events
Creative mode
Shulker recursion depth limit to prevent abuse
๐ PlaceholderAPI Support
Provide full PlaceholderAPI integration:
%worth_single%
%worth_total%
%worth_shulker%
%worth_formatted%
Placeholders must be usable by:
Scoreboards
GUIs
Other plugins
๐ Project Structure
Clean, modular architecture
Separate managers for:
Worth calculation
Cache handling
Lore formatting
Packet interception
Full plugin.yml
Full config.yml
Full fallback_price.yml
Clear class naming and comments
๐ซ Explicitly Disallowed
โ Permanent lore edits
โ Fake items
โ Inventory cloning
โ Item duplication risks
โ Multi-currency systems
โ Tax systems
โ Economy rewrites
๐ฆ Output Expectations
Full source code
Ready-to-compile Gradle project
Optimized for production use
Clean, maintainable, extensible codebase
Kodari can make mistakes. Review important code before using.
Files
No files in this session
Code