这是什么?
MinigameFramework 是一个必需的依赖项,而非一个独立的迷你游戏。它本身不添加任何游戏玩法。如果一个迷你游戏插件(如 HideAndSeek)将此列为依赖项并将你引导至此,那么你来对地方了:安装这个 JAR 文件 以及 那个插件,即可正常使用。
它是所有迷你游戏插件所构建的基础共享层:包括阶段、队伍、观察者模式、GUI、统计数据和进度系统,因此插件作者(包括我自己)无需每次重复构建相同的基础设施。如果你是一名 插件开发者,正在构建自己的迷你游戏,请参阅下方的“面向开发者”部分。
为什么存在
每个 Minecraft 迷你游戏都需要大致相同的支撑结构:游戏阶段、队伍、观察者模式、计分板、自定义物品、GUI、统计数据和进度系统、多语言支持。为每个项目从头构建这些内容是对时间的浪费。MinigameFramework 提供了所有这些作为共享基础,你的迷你游戏插件应继承 MinigameFramework 而不是 JavaPlugin,从而立即获得一个可用的游戏骨架。
包含内容
- 基于阶段的游戏状态机:定义大厅/游戏中/已结束(或自定义)阶段,每个阶段拥有独立的规则集,用于 PvP、方块交互、伤害、饥饿、天气等,可按材料或实体类型配置
- 队伍、观察者和世界管理:队伍颜色和 Boss 条、观察者模式、世界的创建/导入/删除
- 自定义物品与 GUI:冷却时间、有限使用次数、物品变体,以及完整的库存/菜单框架(支持队伍、世界、设置、奖励、外观),并内置交互式世界内地图选择器
- 进度系统:经验值/金币等级、增益道具,以及由等级或 PlaceholderAPI 条件解锁的奖励系统(头衔、徽章、外观、权限、自定义奖励)
- 持久化统计数据:SQL 存储(MySQL 或 SQLite),异步仓库,全局和按迷你游戏划分的统计数据、排行榜,以及可选的基于 Redis 的缓存失效机制以支持多服务器架构
- 游戏内 Wiki:YAML 驱动,附带独立 HTML 编辑器,无需手动编写 Wiki 页面
- 完整的多语言支持(i18n):开箱即用支持英语和德语,支持玩家个人语言偏好,提供用于统计数据/设置/增益道具/奖励的 PlaceholderAPI 扩展
要求
| 组件 |
版本 |
| 服务器软件 |
Paper 1.21 (API 1.21.10+) |
| Java |
21 |
| PlaceholderAPI |
2.11.6+(可选) |
| Redis |
可选,仅用于跨服务器统计缓存 |
安装
- 将
MinigameFramework.jar 放入 plugins/ 目录
- 也将需要它的迷你游戏插件(例如 HideAndSeek)放入
plugins/ 目录
- 启动服务器:控制台应显示
MinigameFramework library loaded successfully!
在 Modrinth 上,基于此框架构建的插件会将其列为 必需依赖项。如果你是通过该链接来到这里的,那么这一步正是你应该做的操作。
存储功能默认禁用(数据不会持久化)。如果你希望统计数据和进度能够保存,请在 config.yml 的 framework.storage 下启用 SQLite 或 MySQL。
面向开发者
完整的 API 文档、架构说明和入门指南(包括一个最小可行迷你游戏示例)可在 GitHub README 中找到。源代码开源,欢迎贡献和问题报告。
What is this?
MinigameFramework is a required dependency, not a minigame by itself. It adds no gameplay on its own. If a minigame plugin like HideAndSeek listed this as a dependency and sent you here, you're in the right place: install this JAR and that plugin, and you're set.
It's the shared foundation minigame plugins are built on top of: phases, teams, spectators, GUIs, stats, and progression, so plugin authors (myself included) don't rebuild the same infrastructure every time. If you're a plugin developer building your own minigame, see the "For developers" section below.
Why it exists
Every Minecraft minigame needs roughly the same scaffolding: game phases, teams, spectator mode, scoreboards, custom items, GUIs, stats and progression, translations. Building that from scratch for every project is a waste of time. MinigameFramework provides all of it as a shared base, your minigame plugin extends MinigameFramework instead of JavaPlugin and gets a working game skeleton immediately.
What's included
- Phase-based game state machine: define lobby/playing/ended (or your own) phases, each with its own rule set for PvP, block interaction, damage, hunger, weather, and more, configurable per-material or per-entity
- Teams, spectators, and world management: team colors and boss bars, spectator mode, world create/import/delete
- Custom items & GUIs: cooldowns, limited uses, item variants, plus a full inventory/menu framework (teams, worlds, settings, rewards, cosmetics) and an interactive in-world map picker
- Progression system: XP/coin levels, boosters, and a reward system (titles, badges, cosmetics, permissions, custom rewards) gated by level or PlaceholderAPI conditions
- Persistent stats: SQL storage (MySQL or SQLite) with async repositories, global and per-minigame stats, leaderboards, and optional Redis-backed cache invalidation for multi-server setups
- In-game wiki: YAML-driven, with a standalone HTML editor included so you're not hand-writing wiki pages
- Full i18n: English and German ship out of the box, per-player language preferences, PlaceholderAPI expansions for stats/settings/boosters/rewards
Requirements
| Component |
Version |
| Server software |
Paper 1.21 (API 1.21.10+) |
| Java |
21 |
| PlaceholderAPI |
2.11.6+ (optional) |
| Redis |
optional, only for cross-server stat caching |
Installing
- Drop
MinigameFramework.jar into plugins/
- Drop the minigame plugin(s) that require it into
plugins/ too (e.g. HideAndSeek)
- Start the server: you should see
MinigameFramework library loaded successfully! in the console
On Modrinth, plugins built on this framework list it as a required dependency, so if you got here via that link, this step is exactly what you're supposed to do.
Storage is disabled by default (nothing persists). Enable SQLite or MySQL under framework.storage in config.yml if you want stats and progression to actually save.
For developers
Full API docs, architecture notes, and a getting-started guide (including a minimal working minigame example) are in the GitHub README. Source is open, contributions and issue reports welcome.
评论 0
登录后参与评分
还没有评论,来抢沙发吧