价格限制
QuickShop 的价格限制功能允许你设置服务器上某个物品的最高与最低价格。

price-restriction.yml 文件可以编辑限制规则。
启用限制
该功能默认禁用。 请在编辑规则之前将其启用。
enable: true
Define global price limits
You can set separate minimum and maximum prices for selling and buying shops.
global: # These options are always enabled and are not controlled by the enable option
selling:
min: 0.01 # Can be zero if you want player create a free shop
max: -1 # Actually this can be up to 1.7976931348623157E308
buying:
min: 0.01
max: -1
新建规则
所有规则都位于配置的 rules 部分。
You can set the default scope for rules that do not define their own scope.
default-rule-scope: BUYING_AND_SELLING
Available scopes are BUYING, SELLING, and BUYING_AND_SELLING.
rules: # Rules set
example1: # Rules name, used for identifier and permission node (quickshop.price.restriction.bypass.<name>)
items:
- STONE_SWORD
- STONE_PICKAXE
- STONE_AXE
- STONE_SHOVEL
- STONE_HOE
currency:
- '*'
scope: BUYING_AND_SELLING
min: 1.0
max: 50.0
example2:
items:
- GOLDEN_SWORD
- GOLDEN_PICKAXE
- GOLDEN_AXE
- GOLDEN_SHOVEL
- GOLDEN_HOE
currency:
- '*'
scope: SELLING
min: 10.0
max: 100.0
example3:
items:
- DIAMOND_SWORD
- DIAMOND_PICKAXE
- DIAMOND_AXE
- DIAMOND_SHOVEL
- DIAMOND_HOE
currency:
- '*'
scope: BUYING
min: 10.0
max: 100.0
example1 和 example2 是规则名称。 可以用任何不重复的名称指代。
scope controls whether the rule applies to buying shops, selling shops, or both. If it is not provided, default-rule-scope is used.
items 是该规则适用的物品列表。
物品名称可以是:
- Bukkit 材料名
- 物品引用标签(添加
@前缀)
currency 只能在多经济模式下使用。
min 是物品的最低价格。
max 是物品的最高价格。
同一规则下所有物品共享价格限制。 若需要分配不同的限制,请新建一条规则。
🆕 在项目黑名单中支持通配符(6.2.0.11+)
QuickShop 现在支持物品配置中使用通配符。
这使得你可以通过简化的配置设置更多的物品,无需逐个列出。
支持的通配符
| 内容 | 含义 |
|---|---|
* | 匹配任意数量字符 |
? | 匹配单个字符 |
大小写不敏感匹配
物品的匹配不需要区分大小写。
*_axe
*_AXE
这两条功能相同。
示例用法
你可以将如下写法:
items:
- WOODEN_AXE
- STONE_AXE
- IRON_AXE
- GOLDEN_AXE
- DIAMOND_AXE
- NETHERITE_AXE
简化为:
items:
- "*_AXE"
更多示例
选择所有刷怪蛋:
items:
- "*_SPAWN_EGG"
选择所有类型的剑:
items:
- "*_SWORD"
单字符匹配:
items:
- "DIAMOND_SPAWN_EG?"
注意事项
- 通配符只能用于材料名称。
- 不会替换物品引用(
@reference)匹配。 - 规则匹配时解析内容。
- 通配符可以简化配置,提升可维护性。
权限
玩家拥有:
quickshop.price.restriction.bypass.<rule-name>
时,可以无视规则限制。