Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ShopUI

ShopUI is a form-based item shop plugin for PowerNukkitX. Players can browse configurable categories, select an item and quantity, review the total price, and buy or sell items using their economy balance.

Requirements

ShopUI will load without LlamaEconomy because it is declared as a soft dependency, but the shop cannot process transactions until an economy provider is available.

Installation

  1. Download ShopUI
  2. Install and configure LlamaEconomy.
  3. Copy ShopUI.jar into the server's plugins directory.
  4. Start the server once to generate the default configuration.
  5. Edit plugins/ShopUI/config.yml to configure the shop.
  6. Restart the server after changing the configuration.

Usage

  • /shop opens the purchase menu (items with an enabled buy price).
  • /sell opens the sale menu (items with an enabled sell price).
  • /sell hand sells items from the held stack only.
  • /sell all sells all saleable items in the players inventory.

Direct sales use the package size configured as amount and the sell price per package. For example, with 13 items and amount: 2, 12 are sold and 1 remains. Unsaleable items and incomplete packages stay in the inventory. max-sale-steps only limits the menu slider, not these commands. If multiple entries match the same item, they are processed in configuration order using the remaining items, so no item is sold twice.

Both commands use the same configured categories and show only categories with available items for their action. Select a category, item and quantity, then confirm the transaction. Both commands can only be used by a player.

Existing server configurations are not overwritten on update. Add sell prices to plugins/ShopUI/config.yml to enable sales, then restart the server.

Configuration

The complete default configuration includes ready-to-use examples. A minimal shop looks like this:

max-purchase-steps: 16
max-sale-steps: 16

categories:
  building_blocks:
    name: Building Blocks
    icon: textures/blocks/stone
    entries:
      stone:
        item: 'minecraft:stone'
        amount: 16
        buy: 25
        sell: 10
        custom-name: Special Stone
        thumbnail: textures/blocks/stone

Global settings

Setting Description Default
max-sale-steps Maximum number of sale quantity options, also limited by inventory contents. Values below 1 are treated as 1. 16
max-purchase-steps Maximum number of options shown in the quantity slider. Values below 1 are treated as 1. 16

Category settings

Setting Required Description
Category ID Yes Unique YAML key used internally, such as building_blocks.
name No Display name. If omitted, the category ID is formatted automatically.
icon No Bedrock resource-pack texture path used by the category button.
entries Yes Section containing the tradable items.

Item settings

Setting Required Description
Entry ID Yes Unique YAML key inside its category. It is also used as the default display name.
item Yes PowerNukkitX item identifier, for example minecraft:stone.
amount Yes Number of items in one package and the increment used by the quantity slider. Must be between 1 and 64.
buy No Purchase price per package. Omit or set to -1 to disable buying; 0 enables free purchases.
sell No Sale price per package. Omit or set to -1 to disable selling; 0 enables sales without payment.
custom-name No Custom name applied to the purchased item and shown in the shop.
thumbnail No Bedrock resource-pack texture path used by the item button.

Buying and selling are independent per item. Set only buy for purchase-only items, only sell for sale-only items, or both for both actions. Entries with neither action enabled are hidden. Existing configurations remain purchase-only. Prices apply to the full amount package.

Quantity slider

The slider works with packages rather than individual items. For an entry with amount: 16, the available quantities are 16, 32, 48, and so on.

The number of options is limited by:

  • max-purchase-steps
  • The player's current balance
  • Safe item-count and price limits

The player's balance and inventory space are checked again when the purchase is confirmed. Sales use max-sale-steps and the number of complete packages in the inventory. Matching includes item type, damage and NBT (including custom names), so modified items are not sold as ordinary items. Inventory contents are checked again on confirmation, and items are removed before the sale proceeds are credited.

Languages

ShopUI automatically uses the player's language and falls back to English. The following languages are included:

  • English
  • Chinese (Simplified)
  • French
  • German
  • Italian
  • Japanese
  • Korean
  • Portuguese (Brazil)
  • Russian
  • Spanish
  • Turkish

About

Create a simple shop for your players

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages