Note: Until this plugin's version number exits the Beta stage, it is not recommended for production use. Additionally, an English Wiki will not be provided prior to that point. Please treat it as a trial. If you encounter any issues while testing the plugin, feel free to report them on Discord or GitHub Issues.
HyphaShop
A highly dynamic, script-assisted, high-performance shop plugin.
Features
- Progressive — advanced features are optional
- Random product pricing
- Random product quantity
- Conditional product listing
- Product stock
- Reusable product configurations (no need to repeat setups)
- Product rarity
- Bundle products
- Basic attribute support (Skull, Flag, Trim, Potion Effect, Custom Model Data)
- Automatic translation of Vanilla item names
- Merchant mode for shops
- Trade logging
- Unified cart-based transactions
- Fully translatable content
- Comprehensive GUI system
- JavaScript-like scripting system
Progressive
If you only need a simple shop plugin to sell vanilla items, you can follow the configuration example in product/wools.yml
.
All advanced features are completely optional and won’t consume extra cpu if unused.
Random Product Pricing
Add the following configuration to enable random pricing like shown in the image:
default-configs:
buy-price:
mean: 80
dev: 10
round: true
sell-price:
mean: 5
dev: 2
Random Product Quantity
Product quantity can accept a script string as a value. It can also adjust pricing based on quantity automatically.
default-configs:
item:
amount: 8 + nextUniform(8, 16)
buy-price:
formula: base * (1 + (Math.random() * 2 - 1) * buy_range) * product_amount
sell-price:
formula: base * (1 + (Math.random() * 2 - 1) * sell_range) * product_amount
products:
GOLD_ORE:
item:
base: gold_ore
buy-price:
context: const base = 200
sell-price:
context: const base = 70
Conditional Product Listing
Scripts can participate in plugin logic at various hooks, including controlling whether a product is listed.
default-configs:
actions:
on-before-list:
- |
const timeStr = papi("%world_time_world%").split(":");
const hours = timeStr[0];
number(hours) >= 20 || number(hours) < 6;
- total_history_bought_amount <= 64
Product Stock
Products can have their own inventory. Once stock is depleted, they can no longer be purchased.
default-configs:
stock:
global:
size: 1024
replenish: true
overflow: true
inherit: true
Reusable Product Configurations
For similar products (e.g., all colors of wool), you can reuse default configurations. This greatly reduces setup complexity.
default-configs:
item:
amount: 16
buy-price:
mean: 80
dev: 10
round: true
sell-price:
mean: 5
dev: 2
rarity: uncommon
cacheable: true
products:
LIGHT_BLUE_WOOL:
item:
base: light_blue_wool
YELLOW_WOOL:
item:
base: yellow_wool
LIME_WOOL:
item:
base: lime_wool
Product Rarity
You can assign a rarity level to each product. This affects the probability of random listing and can also serve as decoration.
rarities:
common:
name: "<gray>Common"
weight: 100
uncommon:
name: "<white>Uncommon"
weight: 80
rare:
name: "<dark_purple>Rare"
weight: 60
Bundle Products
Products can be bundles that contain multiple other products.
When calculating a bundle’s price, the total price of its contents is available as a context variable.
products:
WARM_COLOR_WOOL_BUNDLE:
icon:
base: barrel
amount: 1
name: "<white>Warm toned wool bundle"
lore:
- "<gray>A bundle that contains all"
- "<gold>warm toned<gray>wool."
buy-price:
formula: bundle_total_new * 0.8
sell-price:
disable: true
bundle-contents:
- YELLOW_WOOL
- BROWN_WOOL
- MAGIC_ORANGE_WOOL
- RED_WOOL:3
rarity: rare
Basic Attribute Support
Thanks to high-version Data Component
features, the plugin supports basic attributes for items.
Automatic Translation of Vanilla Item Names
Using the Adventure API
's Translatable Component
mechanism, vanilla item names are automatically translated with no need of manual configuration or downloading language files.
products:
LIME_WOOL:
item:
base: lime_wool
Merchant Mode
Shops can have their own virtual balance. Once depleted, they can no longer buy products from players.
settings:
merchant:
balance: 1000
replenish: true
overflow: true
inherit: true
Trade Logging
Each player’s transactions are recorded in a database for review by themselves or server administrators.
Cart-Based Transactions
In addition to traditional direct purchases, players can add multiple products to a cart and purchase them all at once.
Comprehensive GUI System
Beyond the shop menu, you can use the same GUI configuration logic to create custom GUIs.
JavaScript-Like Scripting System
This plugin includes a built-in scripting system with syntax similar to JavaScript (simplified for function calls), offering high configurability.
Information
Category | Economy |
---|---|
Published on | March 4, 2025 |
License | GPL |
Downloads | 0 |
Stars | 0 |
Watchers | 0 |