Minecraft Sell Plugin — Full Development Prompt
Create a complete, production-ready Minecraft Paper 1.21.11 Sell Plugin for an SMP server.
The plugin should provide a modern Donut SMP / Banana SMP-style selling system with support for:
ShopGUI+
EconomyShopGUI
Vault
NBT-API
PlaceholderAPI
The plugin must be optimized for a real production SMP server, with strong focus on:
Shulker Box selling
Container selling
"/sell"
"/sellgui"
Automatic selling when "/sellgui" closes
ShopGUI+ pricing
EconomyShopGUI pricing
Anti-duplication
Safe inventory handling
Performance
IMPORTANT: DO NOT CREATE ANY SELL WAND SYSTEM OR "/sw" COMMAND.
---
- Server compatibility
Target:
Minecraft 1.21.11
Paper 1.21.11
Java version compatible with Paper 1.21.11
Use modern Paper/Bukkit APIs.
Avoid deprecated APIs unless absolutely necessary.
---
- Plugin integrations
Support:
ShopGUI+
EconomyShopGUI
Vault
NBT-API
PlaceholderAPI
ShopGUI+ and EconomyShopGUI must be optional integrations.
The plugin must not crash if one of them is missing.
---
- Price provider system
The plugin must NOT contain a hardcoded price list.
Prices must come directly from either:
ShopGUI+
EconomyShopGUI
Create a common price-provider system.
Example:
PriceProvider ├── ShopGUIPlusPriceProvider └── EconomyShopGUIPriceProvider
Configuration:
price-provider: type: AUTO
Supported modes:
SHOPGUIPLUS ECONOMYSHOPGUI AUTO
SHOPGUIPLUS
Use ShopGUI+ as the source of sell prices.
ECONOMYSHOPGUI
Use EconomyShopGUI as the source of sell prices.
AUTO
Automatically detect installed supported shop plugins.
Priority:
- ShopGUI+
- EconomyShopGUI
If ShopGUI+ is unavailable but EconomyShopGUI exists, use EconomyShopGUI.
If EconomyShopGUI is unavailable but ShopGUI+ exists, use ShopGUI+.
If neither exists, disable price-dependent selling and show a clear error.
Never invent prices.
---
- ShopGUI+ integration
Hook into the actual ShopGUI+ API.
Retrieve the configured sell price for an ItemStack.
Support:
Normal Minecraft items
Item amounts
Items with metadata
Supported custom items
ShopGUI+ configured prices
Example:
ShopGUI+:
Diamond sell price = $100
Then:
1 Diamond = $100 64 Diamonds = $6,400
Do not hardcode "$100".
The plugin must read the actual configured price.
---
- EconomyShopGUI integration
Hook into the official/supported EconomyShopGUI API.
Do not scrape GUI inventory names, lore, or screenshots.
Retrieve the real configured sell price.
Example:
EconomyShopGUI:
Diamond sell price = $100
Then:
64 Diamonds = $6,400
The exact API implementation must be based on the actual EconomyShopGUI API available for the target version.
Do not invent method names or APIs.
---
- Price provider abstraction
The selling code must not directly depend on ShopGUI+ or EconomyShopGUI.
Create something similar to:
public interface PriceProvider {
OptionalDouble getSellPrice(ItemStack item);
boolean canSell(ItemStack item);
double calculateValue(ItemStack item);
}
Implement:
ShopGUIPlusPriceProvider EconomyShopGUIPriceProvider
This allows the rest of the plugin to work independently of the selected shop plugin.
---
- Vault economy
Use Vault for money payouts.
Selling process:
- Validate items.
- Calculate total.
- Validate total.
- Remove sold items.
- Deposit money through Vault.
- Complete transaction.
Never pay before successfully processing the items.
Prevent:
Negative payouts
NaN values
Infinite values
Overflow
Invalid economy transactions
If an economy transaction fails, safely handle/restore the transaction where possible.
---
- "/sell"
Create:
/sell
This sells all sellable items from the player's normal inventory.
Example inventory:
64 Diamond 32 Emerald 16 Dirt
If:
Diamond = $100 Emerald = $50 Dirt = no sell price
Then:
64 Diamond → sold 32 Emerald → sold 16 Dirt → untouched
Player receives:
$8,000
The command should provide a configurable transaction summary.
Example:
&6&lSELL &8» &aSold items for &6$8,000
---
- "/sellgui"
Create:
/sellgui
This opens a custom selling GUI.
Players can place items into the selling area.
The GUI should show:
Items being sold
Current estimated total
Instructions
Configurable filler
Configurable decoration
Example:
╔══════════════════════════════╗ ║ SELL ITEMS ║ ║ ║ ║ [ ] [ ] [ ] [ ] [ ] [ ] ║ ║ [ ] [ ] [ ] [ ] [ ] [ ] ║ ║ [ ] [ ] [ ] [ ] [ ] [ ] ║ ║ ║ ║ TOTAL: $12,450 ║ ║ ║ ╚══════════════════════════════╝
Make the GUI completely configurable.
---
- Auto-sell on GUI close
This is a core requirement.
The player must NOT be required to press a confirmation button.
When the player closes "/sellgui":
- Scan all selling slots.
- Calculate item values.
- Sell valid items.
- Process supported containers.
- Remove successfully sold contents.
- Keep unsellable items.
- Return containers.
- Deposit money.
- Send a transaction summary.
Configuration:
selling: auto-sell-on-close: true
If disabled, optionally provide a configurable sell button.
---
- Shulker Box selling
This is one of the most important features.
The plugin must sell the contents inside Shulker Boxes.
Example:
Blue Shulker Box ├── 64 Diamond ├── 32 Emerald └── 16 Iron
When the Shulker is sold:
- Detect the Shulker Box.
- Read its internal inventory.
- Find each item's sell price.
- Calculate the total.
- Remove successfully sold items.
- Keep unsellable items.
- Return the Shulker Box.
- Preserve its metadata and NBT.
The Shulker Box itself should not be destroyed.
Default behavior:
Sell contents ↓ Return Shulker Box
---
- Shulker metadata preservation
When returning a Shulker Box, preserve:
Color
Custom name
Lore
Enchantments
Custom Model Data
Persistent Data Container
NBT
Other valid ItemMeta
Only modify its internal inventory.
Do not recreate the Shulker in a way that loses custom information.
Use NBT-API where required.
---
- Partial Shulker selling
Example:
Shulker ├── 64 Diamond ├── 32 Dirt └── 16 Emerald
Suppose:
Diamond = sellable Emerald = sellable Dirt = no sell price
After selling:
Shulker └── 32 Dirt
The player receives the money for:
64 Diamond + 16 Emerald
The Dirt remains inside the returned Shulker.
Never delete unsellable items.
---
- Empty Shulkers
If a Shulker Box is empty:
Do not pay anything.
Return the Shulker normally.
Example:
Empty Shulker → $0 → Shulker returned
---
- Other container support
Support configurable container items where technically possible:
Shulker Boxes
Chests
Barrels
Hoppers
Other container ItemStacks supported by the server/API
Configuration:
containers: shulker: true chest: true barrel: true hopper: true other: false
The plugin must distinguish between:
A container block
A container ItemStack
An ordinary item
Do not process unsupported items as containers.
---
- Nested containers
Prevent recursive selling exploits.
Default:
containers: allow-nested: false
If enabled:
containers: allow-nested: true max-depth: 2
Never allow infinite recursion.
Do not allow a container inside another container to cause duplicated payouts.
---
- Container metadata
When processing containers, preserve their:
ItemMeta
Name
Lore
NBT
Custom Model Data
Persistent data
Color where applicable
Only modify the inventory contents.
---
- Inventory return safety
If an item/container needs to be returned:
- Try to put it back into the player's inventory.
- If inventory is full, safely drop it at the player's location.
- Never delete the item.
- Handle player disconnects safely where practical.
Player items must never disappear because of a plugin error.
---
- Anti-duplication
The plugin must have strong protection against duplication.
Protect against:
Double selling
GUI close exploits
Shift-click exploits
Drag exploits
Number-key exploits
Double-click exploits
Hotbar swaps
Offhand swaps
Player disconnect during transaction
Reopening the GUI
Selling the same Shulker twice
Nested container duplication
Economy transaction failures
Race conditions
Inventory desynchronization
Use transaction locks.
Each sale should only be processed once.
---
- Transaction architecture
Every sale should have a unique transaction ID.
Example:
Transaction #A83F21
Transaction flow:
START ↓ LOCK PLAYER ↓ VALIDATE ↓ CALCULATE ↓ VALIDATE TOTAL ↓ REMOVE ITEMS ↓ RETURN CONTAINERS ↓ DEPOSIT MONEY ↓ UNLOCK ↓ COMPLETE
If something fails:
ROLLBACK
where safely possible.
---
- GUI click protection
Correctly handle:
Normal clicks
Shift-click
Number-key swaps
Double-click
Drag events
Hotbar swaps
Offhand swaps
Drop actions
Creative interactions where applicable
Players must not be able to take GUI filler/control items.
Only configured selling slots should accept items.
---
- Sellable item detection
For every item:
- Check if the selected price provider supports it.
- Retrieve its sell price.
- If no price exists, mark it unsellable.
- Never create a fake price.
Unknown/custom items should remain untouched.
---
- Item matching
Do not identify items only by display name.
Use appropriate server item information such as:
Material
ItemMeta
NBT
PersistentDataContainer
Shop plugin's item matching rules
Respect the pricing plugin's own item-identification system whenever possible.
---
- Custom items
Support custom items when ShopGUI+ or EconomyShopGUI provides a valid sell price.
If a custom item has no configured price:
UNSELLABLE
Do not sell it.
---
- Economy limits
Configuration:
economy: minimum-payout: 0.0 maximum-payout: 1000000000000.0
Before payout:
Verify amount is finite.
Verify amount is positive or zero.
Verify amount does not exceed maximum.
Verify economy provider exists.
---
- Messages
Create:
messages.yml
Example:
prefix: "&6&lSELL &8» "
sell-success: "%prefix%&aSold items for &6$%amount%" no-items: "%prefix%&cThere are no sellable items." no-price: "%prefix%&cThis item has no sell price." shulker-sold: "%prefix%&aSold Shulker contents for &6$%amount%" returned-container: "%prefix%&7Your container has been returned." no-economy: "%prefix%&cEconomy provider is unavailable." no-price-provider: "%prefix%&cNo supported shop plugin was found." reload: "%prefix%&aConfiguration reloaded."
Support:
"&" color codes
Hex colors where supported
PlaceholderAPI
Player name
Total amount
Item amount
Item name
Price provider
---
- PlaceholderAPI
If PlaceholderAPI is installed, optionally provide:
%player_name% %sell_total% %sell_items% %sell_item_count% %sell_price_provider%
Do not require PlaceholderAPI.
---
- GUI configuration
Example:
gui: title: "&8Sell Items" rows: 6
filler: enabled: true material: BLACK_STAINED_GLASS_PANE name: " "
sell-slots:
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 28
- 29
- 30
- 31
- 32
- 33
- 34
total: slot: 49 material: GOLD_INGOT name: "&6Total: &f$%total%"
Make slots configurable.
---
- Main configuration
Create a complete "config.yml".
Example:
plugin: debug: false
price-provider: type: AUTO
integrations: shopguiplus: enabled: true
economyshopgui: enabled: true
vault: enabled: true
nbtapi: enabled: true
placeholderapi: enabled: true
selling: inventory: true sellgui: true auto-sell-on-close: true
containers: shulker: true chest: true barrel: true hopper: true other: false allow-nested: false max-depth: 1
shulker: return-empty-container: true preserve-nbt: true preserve-name: true preserve-lore: true
price-cache: enabled: true duration: 30s
economy: minimum-payout: 0.0 maximum-payout: 1000000000000.0
---
- Performance
This plugin will run on an SMP server.
Optimize it.
Do NOT:
Scan every player every tick.
Scan all chunks.
Scan every container continuously.
Run unnecessary repeating tasks.
Make expensive API calls every tick.
Perform unnecessary synchronous calculations.
Only process inventories when a player actually sells something.
Use safe caching where appropriate.
---
- Bukkit/Paper thread safety
Inventory modifications must be performed safely on the server thread.
Do not access Bukkit inventory APIs asynchronously unless the API explicitly permits it.
Prioritize correctness and item safety.
---
- Dependency detection
On startup, show something like:
[SellPlugin] Starting SellPlugin... [SellPlugin] Paper: 1.21.11 [SellPlugin] ShopGUI+: Hooked [SellPlugin] EconomyShopGUI: Hooked [SellPlugin] Vault: Hooked [SellPlugin] NBT-API: Hooked [SellPlugin] PlaceholderAPI: Hooked [SellPlugin] Price Provider: AUTO [SellPlugin] Selected Provider: ShopGUI+ [SellPlugin] SellGUI: Enabled [SellPlugin] Sell Wand: NOT PRESENT [SellPlugin] SellPlugin enabled successfully.
Do not actually implement a Sell Wand.
The "Sell Wand: NOT PRESENT" line is only an optional indication that no Sell Wand feature exists; it can also simply be omitted.
---
- Missing dependencies
If only ShopGUI+ exists:
Selected provider: ShopGUI+
If only EconomyShopGUI exists:
Selected provider: EconomyShopGUI
If both exist:
Selected provider: ShopGUI+
when using AUTO.
If neither exists:
No supported price provider found.
Do not crash.
---
- Price cache
If safe, support caching.
Configuration:
price-cache: enabled: true duration: 30s
Do not allow stale cached prices to permanently override shop prices.
If the shop plugin provides a reliable direct price lookup, prefer it.
---
- Debug mode
Configuration:
plugin: debug: false
When enabled:
[SellPlugin] Player: Steve [SellPlugin] Item: DIAMOND [SellPlugin] Amount: 64 [SellPlugin] Provider: ShopGUI+ [SellPlugin] Unit price: 100.0 [SellPlugin] Total: 6400.0 [SellPlugin] Transaction completed.
Do not spam the console when debug is disabled.
---
- Project structure
Create a proper Gradle or Maven project.
Example:
SellPlugin/ ├── build.gradle ├── settings.gradle ├── README.md └── src/ └── main/ ├── java/ │ └── ... └── resources/ ├── plugin.yml ├── config.yml └── messages.yml
Suggested packages:
commands/ gui/ selling/ containers/ providers/ providers/shopguiplus/ providers/economyshopgui/ economy/ listeners/ hooks/ utils/ transactions/
---
- Commands
Implement:
/sell /sellgui /sellplugin reload /sellplugin info
Permissions:
sellplugin.sell sellplugin.sellgui sellplugin.admin
Normal players should not need OP to sell.
Admin commands require:
sellplugin.admin
---
- Testing
Test normal items:
1 Diamond
64 Diamonds
Multiple item types
Items without prices
Custom items
Test Shulkers:
Empty Shulker
Full Shulker
Partially sellable Shulker
Colored Shulker
Named Shulker
Shulker with lore
Shulker with NBT
Test GUI:
Normal clicks
Shift-click
Drag
Number keys
Hotbar swap
Offhand swap
Closing GUI
Reopening GUI
Full inventory
Disconnect
Test price providers:
ShopGUI+ only
EconomyShopGUI only
Both installed
Neither installed
AUTO
SHOPGUIPLUS mode
ECONOMYSHOPGUI mode
Test economy:
Normal payout
Large payout
Missing Vault
Failed payout
Test anti-duplication:
Rapid GUI closing
Rapid reopening
Double-clicking
Disconnect during transaction
Server restart
Shulker selling
Nested containers
---
- API verification
Before implementing ShopGUI+ and EconomyShopGUI integrations:
Check the actual APIs and documentation for the versions being targeted.
Do not invent APIs.
Do not create fake methods such as:
shop.getSellPrice(...)
unless that method actually exists in the relevant API.
Use the official supported integration/API whenever possible.
Keep each shop integration isolated behind the "PriceProvider" interface.
---
- Deliverables
Provide the complete buildable project:
- Full Java source code
- "build.gradle" or "pom.xml"
- "settings.gradle" if required
- "plugin.yml"
- "config.yml"
- "messages.yml"
- README
- Required dependencies
- Installation instructions
- Commands
- Permissions
- Configuration documentation
- ShopGUI+ integration
- EconomyShopGUI integration
- Vault integration
- NBT-API integration
- Shulker selling
- Container selling
- "/sell"
- "/sellgui"
- Automatic sell-on-close
- Anti-duplication protection
- Testing instructions
The final plugin must compile successfully and be suitable for installation into:
/plugins/
on a Paper 1.21.11 server.
FINAL CORE REQUIREMENTS
The finished plugin MUST:
- Support ShopGUI+
- Support EconomyShopGUI
- Use their actual configured sell prices
- Never rely on a hardcoded price list
- Support "/sell"
- Support "/sellgui"
- Automatically sell items when "/sellgui" closes
- Sell the contents of Shulker Boxes
- Return the Shulker Box after selling
- Preserve Shulker metadata/NBT
- Keep unsellable items inside the returned container
- Support configurable container selling
- Use Vault for economy payouts
- Use NBT-API where required
- Have strong anti-duplication protection
- Be optimized for Paper 1.21.11
- Handle missing dependencies safely
Do not provide pseudocode only. Build the actual complete plugin source code.