Juel18
๐Ÿ“Ž 1 file 2,803 chars
๐Ÿ“„
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