NightMarket - 基于玩家的随机市场插件
适用于运行 Paper 1.21.1 的 Minecraft 服务器的可配置、基于玩家的“夜市”插件——每位玩家都拥有自己独立的随机商品轮换商店,包含随机折扣,通过在一个整洁的用户界面中翻牌来揭示商品。
✨ 主要功能
? 核心系统
- 基于玩家的随机市场 - 每位玩家都会生成自己独特的一组商品;没有两个市场是完全相同的
- 季节性自动重置 - 市场会锁定直到可配置的季节结束,然后自动重新生成
- 随机折扣 - 每个商品都会获得一个介于您设置的最小/最大值之间的随机折扣;原价、折扣百分比和最终价格会显示出来,并且在重置之前保持不变
- 翻牌式用户界面 - 商品初始为背面朝下,经过短暂动画后翻开,随后变为可购买状态,最后显示“售罄”
- 交互式用户界面 - 为玩家和管理员提供简洁直观菜单
? 管理工具
- 游戏内物品池编辑器 - 无需触碰配置文件即可添加、编辑和移除商品
- 从手中添加物品 - 支持原版物品、Oraxen、ItemsAdder 和 MMOItems,并完整保留 NBT 数据
- 一键命令奖励 - 直接从物品池菜单创建基于命令的商品
- 玩家管理 - 重置单个玩家的市场、刷新市场或一次性重置所有玩家的市场
- 实时重载 - 更新配置文件和语言文件而无需重启服务器
⚡ 性能与安全
- 异步数据库 - 所有保存操作均在主线程之外运行,因此服务器不会因磁盘 I/O 而卡顿
- 有序写入队列 - 单个 FIFO(先进先出)队列确保在市场售出更新之前完成保存,从而保证购买记录在重启时永远不会丢失
- 内存缓存 - 市场和物品池均被缓存以实现即时访问
- 防重复交易保护 - 基于玩家的忙闲锁 + 已售出标志防止双击、竞态条件和物品复制
- 优雅关闭 - 禁用时将待处理的写入安全地刷入存储
- 优雅禁用 - 如果缺少 Vault 或任何经济提供商,插件会在控制台输出清晰消息并自行禁用,而不是报错
? 灵活的奖励
- 每次提供两种奖励类型:
- 物品 - 给予原版或自定义物品
- 命令 - 购买时运行一条或多条控制台命令(排名、套装、货币、箱子钥匙等均可)
- 自定义物品支持 - 支持 Oraxen、ItemsAdder 和 MMOItems(自动检测;购买时重新生成,并带有安全回退机制)
- NBT 保留 - 自定义附魔、描述文本和属性均被保留
- 占位符 -
{player} / %player%、{uuid}、{item_name}、{price};使用 ;; 链接多条命令
? 完全可翻译
✓ 所有 GUI 标题 ✓ 所有物品名称 ✓ 所有描述文本
✓ 所有聊天消息 ✓ MiniMessage 支持 ✓ Hex 颜色与旧版颜色
✓ 包含 en_US ✓ 包含 id_ID ✓ 实时语言切换
? 安装
- 安装 Vault 及一个兼容 Vault 的经济插件(例如 EssentialsX)
- 下载最新的
.jar 文件并将其放入服务器的 plugins 文件夹中
- 重启服务器 ——
config.yml 和语言文件将自动生成
- 运行
/nightmarket admin 开始添加商品
- 随时使用
/nightmarket reload 重载配置
? 命令
玩家命令
/nightmarket 或 /nm - 打开你的夜市场
管理员命令
/nightmarket admin - 打开管理面板
/nightmarket reset <player> - 重置某玩家的市集
/nightmarket resetall - 重置所有玩家的市集
/nightmarket reload - 重载配置文件和语言文件
? 权限
nightmarket.use - 打开市集并进行购买(默认:true)
nightmarket.admin - 管理 GUI 和管理功能(默认:op)
nightmarket.reset - 重置玩家市集(默认:op)
nightmarket.reload - 重载插件(默认:op)
⚙️ 配置
可通过 config.yml 自定义 —— 大多数设置也可在游戏中编辑:
language: en_US
market:
size: 6 # 每位玩家的报价数量
discount-min: 10 # 最小随机折扣 (%)
discount-max: 70 # 最大随机折扣 (%)
duration-hours: 24 # 赛季时长,到期后自动重置
purchase:
drop-if-inventory-full: true
hooks:
custom-items: true # Oraxen / ItemsAdder / MMOItems
? 兼容性
- Minecraft 版本: 1.21.1 (Paper)
- Java 版本: 21+
- 必需依赖: Vault + 一个经济系统提供器
- 可选依赖:
- Oraxen(自定义物品)
- ItemsAdder(自定义物品)
- MMOItems(自定义物品)
? 支持与反馈
发现 Bug 或有建议?请通过以下方式提交问题:
- 服务端版本(例如 Paper 1.21.1)
- 插件版本
- 复现步骤
- 控制台错误信息(如有)
在我们的 Discord 上
由 ResistanceCore ❤️ 制作
如果你喜欢这个插件,请留下一个 ❤️ 并分享给其他服务器管理员!
NightMarket - Per-Player Random Market Plugin
A configurable, per-player "night market" plugin for Minecraft servers running Paper 1.21.1 — every player gets their own rotating shop of random offers with random discounts, revealed by flipping cards in a clean GUI.
✨ Key Features
? Core Systems
- Per-Player Random Markets - Each player rolls their own unique set of offers; no two markets are the same
- Seasonal Auto-Reset - Markets stay locked in until the configurable season ends, then regenerate automatically
- Random Discounts - Every offer gets a random discount between your min/max; original price, discount %, and final price are shown and never change until reset
- Reveal-Card GUI - Offers start face-down and flip open with a short animation, then become buyable, then "Sold Out"
- Interactive GUIs - Clean, intuitive menus for both players and admins
? Admin Tools
- In-Game Item Pool Editor - Add, edit, and remove offers without touching config files
- Add Items from Hand - Supports vanilla, Oraxen, ItemsAdder, and MMOItems with full NBT preservation
- One-Click Command Rewards - Create command-based offers straight from the pool menu
- Player Management - Reset a single player's market, refresh it, or reset everyone at once
- Live Reload - Update config and language files without restarting
⚡ Performance & Safety
- Async Database - All saves run off the main thread, so the server never stalls on disk I/O
- Ordered Write Queue - A single FIFO queue guarantees a market is saved before any sold-out update, so purchases can never be lost across restarts
- In-Memory Caching - Markets and the item pool are cached for instant access
- Anti-Dupe Protection - Per-player busy guard + sold-out flag prevent double-clicks, race conditions, and item duplication
- Graceful Shutdown - Pending writes are flushed safely on disable
- Graceful Disable - If Vault or an economy provider is missing, the plugin disables itself with a clear console message instead of erroring
? Flexible Rewards
- Two Reward Types per Offer:
- Item - Give a vanilla or custom item
- Command - Run one or more console commands on purchase (ranks, kits, money, crate keys, anything)
- Custom Item Support - Oraxen, ItemsAdder, and MMOItems (auto-detected; rebuilt fresh on purchase with a safe fallback)
- NBT Preservation - Custom enchants, lore, and attributes are kept
- Placeholders -
{player} / %player%, {uuid}, {item_name}, {price}; chain commands with ;;
? Fully Translatable
✓ All GUI titles ✓ All item names ✓ All lore
✓ All chat messages ✓ MiniMessage support ✓ Hex & legacy colors
✓ en_US included ✓ id_ID included ✓ Live language switching
? Installation
- Install Vault and a Vault-compatible economy plugin (e.g. EssentialsX)
- Download the latest
.jar and place it in your server's plugins folder
- Restart your server —
config.yml and language files generate automatically
- Run
/nightmarket admin to start adding offers
- Reload anytime with
/nightmarket reload
? Commands
Player Commands
/nightmarket or /nm - Open your Night Market
Admin Commands
/nightmarket admin - Open the admin dashboard
/nightmarket reset <player> - Reset a player's market
/nightmarket resetall - Reset every player's market
/nightmarket reload - Reload config and language files
? Permissions
nightmarket.use - Open and buy from the market (default: true)
nightmarket.admin - Admin GUI and management (default: op)
nightmarket.reset - Reset player markets (default: op)
nightmarket.reload - Reload the plugin (default: op)
⚙️ Configuration
Customizable via config.yml — most settings are also editable in-game:
language: en_US
market:
size: 6 # offers per player
discount-min: 10 # min random discount (%)
discount-max: 70 # max random discount (%)
duration-hours: 24 # season length before auto-reset
purchase:
drop-if-inventory-full: true
hooks:
custom-items: true # Oraxen / ItemsAdder / MMOItems
? Compatibility
- Minecraft Version: 1.21.1 (Paper)
- Java Version: 21+
- Required: Vault + an economy provider
- Optional Dependencies:
- Oraxen (custom items)
- ItemsAdder (custom items)
- MMOItems (custom items)
? Support & Feedback
Found a bug or have a suggestion? Please report issues with:
- Server version (e.g., Paper 1.21.1)
- Plugin version
- Steps to reproduce
- Console errors (if any)
on our discord
Made with ❤️ by ResistanceCore
If you enjoy this plugin, please leave a ❤️ and share it with other server owners!
评论 0
登录后参与评分
还没有评论,来抢沙发吧