Sphinx Riddle - Minecraft 问答竞赛模组
? Minecraft 服务器问答竞赛系统
功能特性
-
自动问答系统
- 可配置间隔的自动出题
- 题目超时处理
- 基于 JSON 的题目与奖励配置
-
智能答案检测
- 包含匹配(例如:“龟派气功” 匹配 “气功”)
- 不区分大小写匹配
- 首位正确玩家获胜机制
-
奖励系统
- 从可配置池中随机选择奖励
- 可变数量的奖励发放
- 使用 MC 物品选择器自动补全物品
-
计分板与排行榜
- 客户端实时计分板显示(可配置)
- 前 15 名玩家排行榜,带颜色标识排名
- 持久化分数存储
-
全面命令支持
- 玩家命令:
/sr question(可配置权限)
- 管理员命令:题目/奖励管理、计分板控制
- 基于权限的命令访问控制
-
易于配置
- JSON 配置文件
- 支持热重载
- 自定义消息和间隔时间
-
国际化 (i18n)
- 完整英文和中文语言支持
- 根据客户端设置自动检测语言
- 易于添加更多语言
快速开始
安装
- 从 Releases 下载最新的
sphinxriddle-x.x-NeoForge-1.21.x.jar
- 将其放入服务器的
mods 文件夹中
- 重启服务器
基本用法
对于玩家:
- 当题目出现时,直接在聊天栏中回答
- 如果配置允许,使用
/sr question 手动开启新题目
- 在右侧计分板上查看你的排名(如果已启用)
对于管理员:
# 重载配置
/sr reload
# 添加题目
/sr add question "What tool mines diamond?" "Iron Pickaxe"
# 添加奖励(支持自动补全)
/sr add reward minecraft:diamond 5
# 管理排行榜
/sr list ranking
/sr reset ranking
配置说明
主配置文件 (config/sphinxriddle-client.toml)
该模组使用 NeoForge 的配置系统,包含以下选项:
| 设置项 |
默认值 |
描述 |
| questionInterval |
300 |
自动出题的时间间隔(秒) |
| questionTimeout |
60 |
题目过期前的时间(秒) |
| autoQuestionEnabled |
true |
启用自动出题 |
| allowManualQuestion |
true |
允许玩家使用 /sr question |
| showScoreboard |
true |
在客户端端显示计分板 |
| questionPrefix |
"&6[问答]&r " |
题目消息的前缀 |
| rewardMessage |
"&a恭喜 %player% 正确回答问题!获得奖励: %reward%" |
奖励公告消息 |
| newQuestionMessage |
"&e新问题: %question% &e(输入答案到聊天框)" |
新题目公告 |
| configReloadedMessage |
"&aSphinxRiddle 配置重载完成" |
配置重载完成消息 |
配置文件中的提示默认为中文。如果需要其他语言,请相应地修改配置文件。
数据文件 (config/sphinxriddle/)
questions.json - 题目与答案配对
rewards.json - 奖励物品及最大数量
scoreboard.json - 玩家分数与排名
示例配置
questions.json:
[
{
"question": "What mob explodes in Minecraft?",
"answer": "Creeper"
}
]
rewards.json:
[
{
"itemId": "minecraft:diamond",
"maxAmount": 5
}
]
命令参考
玩家命令
| 命令 |
描述 |
权限 |
/sr question |
开始一个新问题 |
所有玩家(如果 allowManualQuestion=true)或仅限 OP |
管理员命令
| 命令 |
描述 |
权限 |
/sr reload |
重载配置 |
OP (2) |
/sr add question <question> <answer> |
添加新题目 |
OP (2) |
/sr add reward <item> <maxAmount> |
添加奖励物品 |
OP (2) |
/sr list question |
列出所有题目 |
OP (2) |
/sr list reward |
列出所有奖励 |
OP (2) |
/sr list ranking |
显示排行榜 |
OP (2) |
/sr reset ranking |
重置分数 |
OP (2) |
/sr remove question <question> |
移除题目 |
OP (2) |
/sr remove reward <item> |
移除奖励 |
OP (2) |
语言支持
该模组会根据客户端的语言设置自动支持多种语言:
- English (en_us) - 默认语言
- Chinese (zh_cn) - 简体中文
- Spanish (es_es) - Español
- French (fr_fr) - Français
- German (de_de) - Deutsch
- Japanese (ja_jp) - 日本語
- Russian (ru_ru) - Русский
- Portuguese (pt_br) - Português Brasileiro
- Korean (ko_kr) - 한국어
- Italian (it_it) - Italiano
模组将自动以玩家客户端的语言显示文本。如果某种语言未完全翻译,则回退至英文。
添加新语言
要为新语言提供支持:
- 在
assets/sphinxriddle/lang/ 中创建一个新的 JSON 文件(例如 fr_fr.json)
- 使用与
en_us.json 相同的键添加翻译
- 模组将自动检测并使用相应的语言
示例语言文件结构:
{
"sphinxriddle.command.help.title": "=== Commandes SphinxRiddle ===",
"sphinxriddle.command.help.question": "/sr question - Démarrer une nouvelle question"
// ... 更多翻译
}
开发
从源码构建
git clone https://github.com/SkyDreamLG/SphinxRiddle.git
cd SphinxRiddle
./gradlew build
要求
- Minecraft 1.20.1+
- NeoForge
- Java 17+
该模组使用 Minecraft 的 Component.translatable() 系统处理所有面向用户的文本。在添加新功能时:
· 使用翻译键(translation keys)而非硬编码字符串
· 在 en_us.json 和 zh_cn.json 中提供对应的翻译
· 在需要时使用 %s 占位符进行字符串插值
示例:
// 不要这样做:
Component.literal("Configuration reloaded")
// 请这样做:
Component.translatable("sphinxriddle.command.reload.success")
支持
· GitHub Discussions - 用于提问和技术支持
· Issue Tracker - 用于提交错误报告和功能请求
许可证
本项目遵循 GNU LGPL 2.1 许可证授权,详情请参阅 LICENSE 文件。
注意:
- 记分板显示和手动出题命令可在配置文件中禁用,以便自定义服务器设置。
- 配置文件中的提示信息默认为中文。如需其他语言,请自行修改配置文件。
Sphinx Riddle - Minecraft Quiz Competition Mod
? Quiz Competition System for Minecraft Servers
Features
Quick Start
Installation
- Download the latest
sphinxriddle-x.x-NeoForge-1.21.x.jar from Releases
- Place it in your server's
mods folder
- Restart the server
Basic Usage
For Players:
- Answer questions directly in chat when they appear
- Use
/sr question to manually start a new question (if allowed by config)
- Check your ranking on the right-side scoreboard (if enabled)
For Admins:
# Reload configuration
/sr reload
# Add questions
/sr add question "What tool mines diamond?" "Iron Pickaxe"
# Add rewards with auto-completion
/sr add reward minecraft:diamond 5
# Manage rankings
/sr list ranking
/sr reset ranking
Configuration
Main Configuration (config/sphinxriddle-client.toml)
The mod uses NeoForge's configuration system with the following options:
Setting Default Description
questionInterval 300 Time between auto questions (seconds)
questionTimeout 60 Time before question expires (seconds)
autoQuestionEnabled true Enable automatic questions
allowManualQuestion true Allow players to use /sr question
showScoreboard true Display scoreboard on client side
questionPrefix "&6[问答]&r " Prefix for question messages
rewardMessage "&a恭喜 %player% 正确回答问题!获得奖励: %reward%" Reward announcement message
newQuestionMessage "&e新问题: %question% &e(输入答案到聊天框)" New question announcement
configReloadedMessage "&aSphinxRiddle 配置重载完成" Config reload message
The prompt information in the configuration file defaults to Chinese. If you need other languages, please modify the configuration file accordingly
Data Files (config/sphinxriddle/)
· questions.json - Question and answer pairs
· rewards.json - Reward items and maximum amounts
· scoreboard.json - Player scores and rankings
Example Configuration
questions.json:
[
{
"question": "What mob explodes in Minecraft?",
"answer": "Creeper"
}
]
rewards.json:
[
{
"itemId": "minecraft:diamond",
"maxAmount": 5
}
]
Commands Reference
Player Commands
Command Description Permission
/sr question Start a new question All players (if allowManualQuestion=true) or OP only
Admin Commands
Command Description Permission
/sr reload Reload configuration OP (2)
/sr add question <question> <answer> Add new question OP (2)
/sr add reward <item> <maxAmount> Add reward item OP (2)
/sr list question List all questions OP (2)
/sr list reward List all rewards OP (2)
/sr list ranking Show leaderboard OP (2)
/sr reset ranking Reset scores OP (2)
/sr remove question <question> Remove question OP (2)
/sr remove reward <item> Remove reward OP (2)
Language Support
The mod supports multiple languages automatically based on the client's language setting:
· English (en_us) - Default language
· Chinese (zh_cn) - 简体中文
· Spanish (es_es) - Español
· French (fr_fr) - Français
· German (de_de) - Deutsch
· Japanese (ja_jp) - 日本語
· Russian (ru_ru) - Русский
· Portuguese (pt_br) - Português Brasileiro
· Korean (ko_kr) - 한국어
· Italian (it_it) - Italiano
The mod will automatically display text in the player's client language. If a language is not fully translated, it will fall back to English.
Adding New Languages
To add support for a new language:
- Create a new JSON file in assets/sphinxriddle/lang/ (e.g., fr_fr.json)
- Add translations using the same keys as in en_us.json
- The mod will automatically detect and use the appropriate language
Example language file structure:
{
"sphinxriddle.command.help.title": "=== Commandes SphinxRiddle ===",
"sphinxriddle.command.help.question": "/sr question - Démarrer une nouvelle question"
// ... more translations
}
Development
Building from Source
git clone https://github.com/SkyDreamLG/SphinxRiddle.git
cd SphinxRiddle
./gradlew build
Requirements
· Minecraft 1.20.1+
· NeoForge
· Java 17+
Internationalization
The mod uses Minecraft's Component.translatable() system for all user-facing text. When adding new features:
· Use translation keys instead of hardcoded strings
· Provide translations in both en_us.json and zh_cn.json
· Use string interpolation with %s placeholders when needed
Example:
// Instead of:
Component.literal("Configuration reloaded")
// Use:
Component.translatable("sphinxriddle.command.reload.success")
Support
· GitHub Discussions - For questions and support
· Issue Tracker - For bug reports and feature requests
License
This project is licensed under the GNU LGPL 2.1 License - see the LICENSE file for details.
Note:
- The scoreboard display and manual question commands can be disabled in the configuration file for server customization.
- The prompt information in the configuration file defaults to Chinese. If you need other languages, please modify the configuration file accordingly
评论 0
登录后参与评分
还没有评论,来抢沙发吧