Gap

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.

---

  1. 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.

---

  1. 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.

---

  1. 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:

  1. ShopGUI+
  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. Vault economy

Use Vault for money payouts.

Selling process:

  1. Validate items.
  1. Calculate total.
  1. Validate total.
  1. Remove sold items.
  1. Deposit money through Vault.
  1. 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.

---

  1. "/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

---

  1. "/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.

---

  1. 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":

  1. Scan all selling slots.
  1. Calculate item values.
  1. Sell valid items.
  1. Process supported containers.
  1. Remove successfully sold contents.
  1. Keep unsellable items.
  1. Return containers.
  1. Deposit money.
  1. Send a transaction summary.

Configuration:

selling: auto-sell-on-close: true

If disabled, optionally provide a configurable sell button.

---

  1. 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:

  1. Detect the Shulker Box.
  1. Read its internal inventory.
  1. Find each item's sell price.
  1. Calculate the total.
  1. Remove successfully sold items.
  1. Keep unsellable items.
  1. Return the Shulker Box.
  1. Preserve its metadata and NBT.

The Shulker Box itself should not be destroyed.

Default behavior:

Sell contents ↓ Return Shulker Box

---

  1. 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.

---

  1. 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.

---

  1. Empty Shulkers

If a Shulker Box is empty:

Do not pay anything.

Return the Shulker normally.

Example:

Empty Shulker → $0 → Shulker returned

---

  1. 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.

---

  1. 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.

---

  1. Container metadata

When processing containers, preserve their:

ItemMeta

Name

Lore

NBT

Custom Model Data

Persistent data

Color where applicable

Only modify the inventory contents.

---

  1. Inventory return safety

If an item/container needs to be returned:

  1. Try to put it back into the player's inventory.
  1. If inventory is full, safely drop it at the player's location.
  1. Never delete the item.
  1. Handle player disconnects safely where practical.

Player items must never disappear because of a plugin error.

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. Sellable item detection

For every item:

  1. Check if the selected price provider supports it.
  1. Retrieve its sell price.
  1. If no price exists, mark it unsellable.
  1. Never create a fake price.

Unknown/custom items should remain untouched.

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. 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

---

  1. PlaceholderAPI

If PlaceholderAPI is installed, optionally provide:

%player_name% %sell_total% %sell_items% %sell_item_count% %sell_price_provider%

Do not require PlaceholderAPI.

---

  1. 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.

---

  1. 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

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. 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.

---

  1. 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/

---

  1. 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

---

  1. 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

---

  1. 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.

---

  1. Deliverables

Provide the complete buildable project:

  1. Full Java source code
  1. "build.gradle" or "pom.xml"
  1. "settings.gradle" if required
  1. "plugin.yml"
  1. "config.yml"
  1. "messages.yml"
  1. README
  1. Required dependencies
  1. Installation instructions
  1. Commands
  1. Permissions
  1. Configuration documentation
  1. ShopGUI+ integration
  1. EconomyShopGUI integration
  1. Vault integration
  1. NBT-API integration
  1. Shulker selling
  1. Container selling
  1. "/sell"
  1. "/sellgui"
  1. Automatic sell-on-close
  1. Anti-duplication protection
  1. 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:

  1. Support ShopGUI+
  1. Support EconomyShopGUI
  1. Use their actual configured sell prices
  1. Never rely on a hardcoded price list
  1. Support "/sell"
  1. Support "/sellgui"
  1. Automatically sell items when "/sellgui" closes
  1. Sell the contents of Shulker Boxes
  1. Return the Shulker Box after selling
  1. Preserve Shulker metadata/NBT
  1. Keep unsellable items inside the returned container
  1. Support configurable container selling
  1. Use Vault for economy payouts
  1. Use NBT-API where required
  1. Have strong anti-duplication protection
  1. Be optimized for Paper 1.21.11
  1. Handle missing dependencies safely

Do not provide pseudocode only. Build the actual complete plugin source code.

Kodari AI
KodariSep 18 at 6:22 am 3
SellPluginPro
A production-ready Paper 1.21.11 SMP sell plugin providing /sell and /sellgui commands with automatic sell-on-close. Integrates ShopGUI+ and EconomyShopGUI as optional price providers through a common PriceProvider interface, uses Vault for payouts, and supports selling Shulker Box and container contents while preserving metadata and NBT. Features strong anti-duplication transaction locking, configurable GUI, PlaceholderAPI support, price caching, and safe handling of missing dependencies.
  1. Create the Gradle project, plugin metadata, configuration, messages, and README.

  2. Build the provider/economy integration layer using verified optional APIs.

  3. Implement transactional selling, container/shulker processing, rollback, and inventory safety.

  4. Implement /sell, /sellgui, GUI protections, reload/info commands, and hooks.

  5. Wire startup registration and dependency detection.

The core project and transaction path are in place. I’m tightening the GUI behavior now so control slots cannot be manipulated and the displayed estimate updates after valid inventory changes.1. Created the complete Gradle Paper 1.21.11 project with Java 21, plugin.yml, configuration, messages, README, and optional dependency metadata. 2. Added isolated ShopGUI+ and EconomyShopGUI price providers using their documented APIs through reflection, with AUTO, SHOPGUIPLUS, and ECONOMYSHOPGUI selection. 3. Implemented Vault economy detection and safe payouts with finite-value, minimum, maximum, and transaction-success checks. 4. Implemented /sell and /sellgui, including automatic sell-on-close behavior. 5. Added transactional locking, rollback-oriented inventory handling, unsellable-item preservation, full-inventory return safety, and item dropping when necessary. 6. Added configurable shulker box, chest, barrel, hopper, nested-container, and metadata-preserving container processing. 7. Added GUI protections for filler/control slots, shift-clicks, number keys, double-clicks, offhand swaps, creative actions, drops, and drag interactions. 8. Added /sellplugin reload and /sellplugin info. 9. No sell wand system or /sw command was created.

Gap

GapSell Branding

The plugin name is:

GapSell

The main plugin name/color should use:

&c&lGapSell

The developer name is:

GapPlayz

Startup Console Banner

When the plugin starts, display a large professional ASCII banner with ONLY "GAP" in very large text.

Use this style:

██████╗ █████╗ ██████╗ ██╔════╝ ██╔══██╗██╔══██╗ ██║ ███╗███████║██████╔╝ ██║ ██║██╔══██║██╔═══╝ ╚██████╔╝██║ ██║██║ ╚═════╝ ╚═╝ ╚═╝╚═╝

Under the large GAP text, display:

GapSell Developed by GapPlayz

The startup console should look similar to:

============================================================

██████╗ █████╗ ██████╗ ██╔════╝ ██╔══██╗██╔══██╗ ██║ ███╗███████║██████╔╝ ██║ ██║██╔══██║██╔═══╝ ╚██████╔╝██║ ██║██║ ╚═════╝ ╚═╝ ╚═╝╚═╝

GapSell Developed by GapPlayz

============================================================

[GapSell] Starting GapSell... [GapSell] ShopGUI+: Hooked [GapSell] EconomyShopGUI: Hooked [GapSell] Vault: Hooked [GapSell] NBT-API: Hooked [GapSell] PlaceholderAPI: Hooked

[GapSell] Price Provider: AUTO [GapSell] Selected Provider: ShopGUI+

[GapSell] SellGUI: Enabled [GapSell] Shulker Selling: Enabled [GapSell] Container Selling: Enabled

[GapSell] GapSell has been enabled successfully!

============================================================

Important

  • The large ASCII text must only say "GAP".
  • Do not make "GapSell" into large ASCII art.
  • "GapSell" should appear normally underneath the large GAP.
  • "Developed by GapPlayz" should appear underneath "GapSell".
  • The banner should appear every time the plugin starts.
  • Add a configuration option:

branding: startup-banner: true

If "startup-banner: false", do not display the large ASCII banner.

Do not add any Sell Wand or "/sw" functionality.

Kodari AI
KodariSep 18 at 7:23 am 2
  1. Inspect the existing plugin bootstrap, configuration, and resource files.

  2. Add the configurable GapSell startup banner and exact startup status output.

  3. Preserve existing integrations and ensure no Sell Wand or /sw functionality is introduced.

  1. Added configurable branding.startup-banner: true to config.yml.

  2. Added the requested large GAP ASCII banner with GapSell and GapPlayz branding.

  3. Added startup status output for providers, price selection, SellGUI, shulker selling, and container selling.

  4. Updated plugin branding to GapSell, developer to GapPlayz, and player message prefix to &c&lGapSell.

  5. Confirmed no Sell Wand or /sw functionality was added.

Gap

GAPSELL COMMANDS & ALIASES

The main plugin command is:

/gapsell

Add the short alias:

/gs

Both commands must provide the same functionality.

Examples:

/gapsell /gs

/gapsell sell /gs sell

/gapsell sellgui /gs sellgui

/gapsell reload /gs reload

/gapsell info /gs info

The plugin should also support the namespaced forms automatically:

/gapsell:sell /gapsell:sellgui /gapsell:reload /gapsell:info

And, where applicable, the namespaced alias:

/gs:sell /gs:sellgui /gs:reload /gs:info

Register the command in "plugin.yml" similar to:

commands: gapsell: description: Main GapSell command aliases: - gs usage: /gapsell [sell|sellgui|reload|info] permission: gapsell.use

Permissions:

gapsell.use gapsell.sell gapsell.sellgui gapsell.admin

Normal players should be able to use "/gs" and "/gapsell" according to the configured permissions.

The "/gs" alias must NOT be treated as a separate plugin or separate command system. It is simply a short alias for GapSell.

Do not add "/sw" or any Sell Wand functionality.

Kodari AI
KodariSep 18 at 7:29 am 1
  1. Add a unified /gapsell command with gs alias and subcommands.

  2. Route sell, sellgui, reload, and info through the existing command implementations with the requested permissions.

  3. Update plugin.yml permissions and command registration without adding /sw.

  1. Added unified /gapsell and /gs command handling.

  2. Added subcommands:

    • /gapsell sell

    • /gapsell sellgui

    • /gapsell reload

    • /gapsell info

  3. Added namespaced forms for both gapsell and gs.

  4. Added permissions:

    • gapsell.use

    • gapsell.sell

    • gapsell.sellgui

    • gapsell.admin

  5. Added tab completion filtered by permissions.

  6. Preserved the existing command implementations and added no /sw or Sell Wand functionality.

Gap

FINAL SELLGUI LAYOUT — NO FILLER

The "/sellgui" must have NO FILLER WHATSOEVER.

There must be no:

  • Glass panes
  • Decorative items
  • Empty protected slots
  • Background items
  • Border items
  • Placeholder items
  • Automatic filler

SELL SLOT RULE

Every GUI slot must be a sell slot EXCEPT the configured Gold/Total slot.

For example, with a 6-row GUI:

[SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL] [SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL] [SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL] [SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL] [SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL][SELL] [SELL][SELL][SELL][SELL][SELL][GOLD][SELL][SELL][SELL]

The only protected slot is the Gold/Total slot.

Example:

gui: rows: 6

total: enabled: true slot: 49 material: GOLD_INGOT name: "&6&lTotal: &f$%total%"

If slot "49" contains the Gold item, then:

Slot 49 = PROTECTED TOTAL SLOT

Every other slot = SELL SLOT

IMPORTANT

Do NOT require a "sell-slots:" list.

By default, GapSell must automatically treat every slot except the Total/Gold slot as a sell slot.

For a 6-row GUI:

0-53 = GUI slots

49 = Gold/Total slot

0-48 and 50-53 = SELL SLOTS

Therefore players can place items anywhere in the GUI except slot 49.

---

GOLD/TOTAL ITEM

The Gold item is the ONLY special GUI item.

Example:

Material:

GOLD_INGOT

Name: &6&lTotal: &f$%total%

It must display the current calculated selling value.

Example:

&6&lTotal: &f$12,450

The Gold item must:

  • Be protected
  • Never be taken by the player
  • Never accept items
  • Never be moved
  • Never be shift-clicked out
  • Never be replaced with a player's item
  • Never be draggable
  • Never be hotbar-swapped
  • Never be duplicated

---

ALL OTHER SLOTS

Every other slot must be a legitimate sell slot.

Players can:

  • Left-click
  • Right-click
  • Shift-click
  • Drag
  • Number-key transfer
  • Hotbar swap
  • Move items between sell slots
  • Remove items from sell slots

Do NOT cancel legitimate item movement.

---

SHIFT-CLICK

If the player shift-clicks an item from their normal inventory:

Player Inventory 64 Diamond

SHIFT CLICK ↓ SellGUI

the plugin must place it into the first available sell slot.

Because all non-Gold slots are sell slots, there should normally be plenty of space.

---

DRAG

Dragging must work across any sell slots.

For example:

Player holds items ↓ Drag across GUI ↓ Items enter sell slots

If the drag includes the Gold/Total slot, the plugin must prevent the Gold slot from receiving the item while still allowing the item to be placed into valid sell slots where possible.

Do NOT cancel the entire drag unnecessarily.

---

NORMAL CLICK

All non-Gold slots behave like normal inventory slots.

Support:

LEFT CLICK RIGHT CLICK SHIFT CLICK DOUBLE CLICK NUMBER KEY HOTBAR OFFHAND DRAG

where Minecraft's normal inventory behavior permits it.

---

NO ANTI-CLICK

There must be NO global anti-click system.

Do NOT do:

if (sellGui) { event.setCancelled(true); }

Instead:

If clicked slot == Gold/Total slot → protect it

Otherwise → treat slot as a Sell Slot → allow normal item interaction

---

TOTAL UPDATE

Whenever items change in the SellGUI:

Recalculate total

Update after:

  • Normal click
  • Right click
  • Shift-click
  • Drag
  • Number key
  • Hotbar movement
  • Item removal
  • Item addition

Example:

64 Diamond = $6,400 32 Emerald = $1,600

Gold Item:

&6&lTotal: &f$8,000

---

GUI CLOSE

When the player closes "/sellgui":

Read every sell slot ↓ Ignore Gold/Total slot ↓ Calculate prices ↓ Process Shulkers/containers ↓ Sell valid items ↓ Keep unsellable items ↓ Return containers ↓ Pay player

The Gold item itself must NEVER be included in the sale.

---

FINAL RULE

The SellGUI has exactly two types of slots:

  1. SELL SLOT
  2. GOLD/TOTAL SLOT

There are NO filler slots.

For example, in a 54-slot GUI:

53 SELL SLOTS + 1 GOLD/TOTAL SLOT = 54 TOTAL SLOTS

If the Gold slot is changed from:

slot: 49

to:

slot: 53

then:

0-52 = SELL SLOTS 53 = GOLD/TOTAL SLOT

Everything must automatically adapt.

Do not hardcode the Gold slot either; read it from configuration.

This is the required final SellGUI behavior.

Kodari AI
KodariSep 18 at 9:06 am 2
  1. Inspect the existing SellGUI, sale-processing flow, configuration, and inventory listeners.

  2. Rework SellGUI slot handling so only the configured total slot is protected and every other slot remains a normal sell slot.

  3. Add precise click/drag/shift-transfer handling and live total refresh without filler items.

  4. Update close processing and configuration so the total slot is excluded from sales and all behavior adapts to the configured slot.

Implemented the final SellGUI behavior:

  • Removed all filler, decorative, background, and placeholder items.

  • Every GUI slot is now a sell slot except the configured total slot.

  • Added gui.total.enabled.

  • Total slot is read dynamically from gui.total.slot; no hardcoded sell-slot list remains.

  • Gold/Total item is protected from:

    • Clicking

    • Shift-clicking

    • Dragging

    • Number-key transfers

    • Hotbar swaps

    • Offhand movement

    • Replacement or removal

  • Normal item interactions remain enabled in all sell slots.

  • Shift-clicking from the player inventory now moves items into available sell slots.

  • Dragging across valid slots works, while the total slot is excluded.

  • Total recalculates after inventory changes.

  • The total item is excluded from close-time selling.

  • Items are returned safely when auto-sell-on-close is disabled.

  • Updated the default configuration to remove sell-slots and filler settings.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
README.md
settings.gradle
Code
22 1,024
src/main/java/com/kodari/sellplugin/SellPlugin.java
package com.kodari.sellplugin;

import com.kodari.sellplugin.command.AdminCommand;
import com.kodari.sellplugin.command.GapSellCommand;
import com.kodari.sellplugin.command.SellCommand;
import com.kodari.sellplugin.command.SellGuiCommand;
import com.kodari.sellplugin.economy.EconomyService;
import com.kodari.sellplugin.gui.SellGuiListener;
import com.kodari.sellplugin.provider.ProviderManager;
import com.kodari.sellplugin.selling.SaleTransaction;
import com.kodari.sellplugin.util.Messages;
import org.bukkit.Bukkit;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class SellPlugin extends JavaPlugin {
    private Messages messages;
    private ProviderManager providers;
    private EconomyService economy;
    private SaleTransaction transactions;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        saveResource("messages.yml", false);
        messages = new Messages(this);
        economy = new EconomyService(this);
        providers = new ProviderManager(this);
        transactions = new SaleTransaction(this, providers, economy, messages);

        Bukkit.getPluginManager().registerEvents(new SellGuiListener(this, transactions, messages), this);
        registerCommands();
        logStartup();
        logStatus();
        getLogger().info("GapSell has been enabled successfully!");
        getLogger().info("============================================================");
    }

    private void registerCommands() {
        PluginCommand gapSell = getCommand("gapsell");
        if (gapSell != null) gapSell.setExecutor(new GapSellCommand(this, transactions, providers, economy, messages));
        PluginCommand sell = getCommand("sell");
        if (sell != null) sell.setExecutor(new SellCommand(transactions, providers, economy, messages));
        PluginCommand sellGui = getCommand("sellgui");
        if (sellGui != null) sellGui.setExecutor(new SellGuiCommand(this, transactions, providers, economy, messages));
        PluginCommand admin = getCommand("sellplugin");
        if (admin != null) admin.setExecutor(new AdminCommand(this, messages));
    }

    public void reloadPlugin() {
        reloadConfig();
        messages.reload();
        providers.reload();
        economy.reload();
        logStatus();
    }

    private void logStartup() {
        if (getConfig().getBoolean("branding.startup-banner", true)) {
            getLogger().info("============================================================");
            getLogger().info("");
            getLogger().info(" ██████╗  █████╗ ██████╗ ");
            getLogger().info("██╔════╝ ██╔══██╗██╔══██╗");
            getLogger().info("██║  ███╗███████║██████╔╝");
            getLogger().info("██║   ██║██╔══██║██╔═══╝ ");
            getLogger().info("╚██████╔╝██║  ██║██║     ");
            getLogger().info(" ╚═════╝ ╚═╝  ╚═╝╚═╝     ");
            getLogger().info("");
            getLogger().info("                     GapSell");
            getLogger().info("                Developed by GapPlayz");
            getLogger().info("");
            getLogger().info("============================================================");
        }
        getLogger().info("Starting GapSell...");
    }

    private void logStatus() {
        getLogger().info("ShopGUI+: " + (providers.hasShopGuiPlus() ? "Hooked" : "Unavailable"));
        getLogger().info("EconomyShopGUI: " + (providers.hasEconomyShopGui() ? "Hooked" : "Unavailable"));
        getLogger().info("Vault: " + (economy.isAvailable() ? "Hooked" : "Unavailable"));
        getLogger().info("NBT-API: " + (Bukkit.getPluginManager().getPlugin("NBTAPI") != null ? "Hooked" : "Unavailable"));
        getLogger().info("PlaceholderAPI: " + (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null ? "Hooked" : "Unavailable"));
        getLogger().info("");
        getLogger().info("Price Provider: " + getConfig().getString("price-provider.type", "AUTO").toUpperCase());
        getLogger().info("Selected Provider: " + providers.getName());
        getLogger().info("");
        getLogger().info("SellGUI: " + (getConfig().getBoolean("selling.sellgui", true) ? "Enabled" : "Disabled"));
        getLogger().info("Shulker Selling: " + (getConfig().getBoolean("containers.shulker", true) ? "Enabled" : "Disabled"));
        boolean containerSelling = getConfig().getBoolean("containers.shulker", true)
                || getConfig().getBoolean("containers.chest", true)
                || getConfig().getBoolean("containers.barrel", true)
                || getConfig().getBoolean("containers.hopper", true)
                || getConfig().getBoolean("containers.other", false);
        getLogger().info("Container Selling: " + (containerSelling ? "Enabled" : "Disabled"));
    }

    public Messages messages() { return messages; }
    public ProviderManager providers() { return providers; }
    public EconomyService economy() { return economy; }
    public SaleTransaction transactions() { return transactions; }
}