注意: 在该插件版本号退出 Beta 阶段之前,不建议在生产环境中使用。此外,在此之前不会提供英文维基文档。请将其视为测试版本。如果在测试插件时遇到任何问题,欢迎在 Discord 或 GitHub Issues 上报告。
官方文档:
HyphaShop
一款高度动态、脚本辅助、高性能的商店插件。
功能特性
- 渐进式扩展 —— 高级功能均为可选
- 随机商品定价
- 随机商品数量
- 条件性上架商品
- 商品库存管理
- 可复用的商品配置(无需重复设置)
- 商品稀有度
- 捆绑商品
- 基础属性支持(头颅、旗帜图案、盔甲纹饰、药水效果、自定义模型数据)
- 自动翻译原版物品名称
- 商人模式
- 交易日志记录
- 统一的购物车结算系统
- 内容完全可翻译
- 全面的 GUI 系统
- 类 JavaScript 脚本系统
渐进式扩展
如果你只需要一个简单的商店插件来售卖原版物品,可以参考 product/wools.yml 中的配置示例。
所有高级功能均为完全可选,如果未启用则不会消耗额外的 CPU 资源。
随机商品定价
添加以下配置以启用如图所示的随机定价:
default-configs:
buy-price:
mean: 80
dev: 10
round: true
sell-price:
mean: 5
dev: 2

随机商品数量
商品数量可以接受脚本字符串作为值。它还可以根据数量自动调整价格。
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

条件性上架商品
脚本可以在各种钩子中参与插件逻辑,包括控制商品是否上架。
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
商品库存
商品可以拥有独立的库存。一旦库存耗尽,便无法再购买。
default-configs:
stock:
global:
size: 1024
replenish: true
overflow: true
inherit: true

可复用的商品配置
对于相似的商品(例如所有颜色的羊毛),你可以复用默认配置。这大大降低了设置复杂度。
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

商品稀有度
你可以为每个商品分配一个稀有度等级。这会影响随机上架的概率,也可用作装饰展示。
rarities:
common:
name: "<gray>Common"
weight: 100
uncommon:
name: "<white>Uncommon"
weight: 80
rare:
name: "<dark_purple>Rare"
weight: 60
捆绑商品
商品可以是包含多个其他商品的捆绑包。
在计算捆绑包价格时,其内容的总价格可作为上下文变量使用。
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

基础属性支持
得益于高版本的 Data Component 特性,该插件支持物品的基础属性。

自动翻译原版物品名称
利用 Adventure API 的 Translatable Component 机制,原版物品名称会被自动翻译,无需手动配置或下载语言文件。
products:
LIME_WOOL:
item:
base: lime_wool

商人模式
商店可以拥有自己的虚拟余额。一旦余额耗尽,商店将无法再从玩家处购买商品。
settings:
merchant:
balance: 1000
replenish: true
overflow: true
inherit: true

交易日志记录
每位玩家的交易记录都会被保存在数据库中,供本人或服务器管理员查阅。

基于购物车的交易
除了传统的直接购买外,玩家还可以将多个商品添加到购物车中,并一次性完成购买。

全面的 GUI 系统
除了商店菜单外,您还可以使用相同的 GUI 配置逻辑来创建自定义 GUI。
JavaScript 风格的脚本系统
该插件内置了一个脚本系统,其语法类似于 JavaScript(函数调用部分进行了简化),提供了高度的可配置性。
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.
Official Document:
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.
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
下载 HyphaShop
需要联机服务器吗?
稳定流畅、一键部署,几分钟即可和朋友联机开服
最低仅需 8 元/月 即可畅快联机
新增
更改
- 更新依赖
修复
- 修复 ItemsAdder 集成
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
ExyliaPlugins 的库。
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
使床在所有维度中爆炸的模组
插件
为 Armor Poser 模组添加兼容性
插件
SkyBlock、OneBlock、Boxed、SkyGrid、AcidIsland、CaveBlock、Poseidon、StrangerRealms——以及更多!这些只是由 BentoBox 支持的基于岛屿的游戏模式之一。来自原版 ASkyBlock 的作者。
插件
一个在游戏内运行的 Minecraft 地图编辑器! 支持选区、蓝图、复制粘贴、笔刷和脚本。 可在创造模式中使用,也可在生存模式中临时使用。
评论 0
登录后参与评分
还没有评论,来抢沙发吧