特性
- 9 种不同的迷你游戏,均可单独开启或关闭
- 完全可自定义,所有词库、问题、消息和奖励均在配置文件中设置
- 回合可按随机间隔自动开始,或通过命令触发
- 奖励组带有概率机制,胜利时可获得基础奖励以及稀有额外奖励
- 胜利统计、个人最佳成绩和排行榜,支持存储在 SQLite、H2、MySQL 或 MariaDB 中
- 不想参与游戏的玩家可通过单一命令静音这些游戏
- 不会造成卡顿,所有内容均缓存在内存中,并在主线程之外保存
- 支持 MiniMessage(旧的
& 代码也兼容)
迷你游戏
Unscramble - 出现一个打乱的单词,输入还原后的正确单词
Reverse - 出现一个倒序打印的单词,按正确顺序输入
Math - 解答生成的数学题,第一个答对者获胜
Fast Type - 原样重新输入一句句子,打字速度最快者获胜
Trivia - 包含 55 个 Minecraft 相关问题,每题有多个正确答案
Reaction - 出现随机令牌,纯粹考验反应速度
Hot & Cold - 猜测秘密数字,每人获得私密的“热/冷”提示反馈
Item Pick - 点击聊天按钮,在满的双层箱子中找到指定名称的物品
Lucky Loot - 共享的箱子板,其中一个藏有奖品,空箱子会对所有人消失
Item Pick 有时会隐藏相同的物品 2-3 次,你需要点击每一个副本。
Lucky Loot 对所有查看该面板的玩家实时更新。
命令与权限
命令
/chatgames (/cg, /minigames) - 打开帮助菜单
/chatgames play - 加入当前的点击即玩游戏
/chatgames info - 显示正在运行的游戏或下一轮开始的时间
/chatgames stats [player] - 查看胜利统计数据
/chatgames top [game] - 查看排行榜
/chatgames toggle - 静音或取消静音迷你游戏
/chatgames start [game] - 立即开始一轮游戏
/chatgames stop - 取消当前运行的回合
/chatgames list - 列出所有迷你游戏及其状态
/chatgames storage - 测试统计数据库连接
/chatgames reload - 重新加载所有配置
/chatgames resetstats - 清除所有统计数据
权限
chatgames.play - 允许回答迷你游戏问题
chatgames.receive - 允许查看迷你游戏广播
chatgames.stats - 允许查看统计数据和排行榜
chatgames.toggle - 允许静音迷你游戏
chatgames.admin - 开始、停止、重载、存储测试和重置
预览
配置
每个迷你游戏都有其独立的配置文件,位于 plugins/ChatGames/games/ 目录下,因此你可以编辑单个游戏而不影响其他游戏。更新添加的新选项会自动合并到你的文件中,你的修改永远不会被覆盖。
奖励
奖励是一个列表形式的组。每个组都会独立进行概率判定,因此胜利可能不发放任何奖励,也可能发放一组或多组奖励:
rewards:
commands:
- chance: 1.0
commands:
- "give %player% diamond 1"
- chance: 0.05
commands:
- "give %player% netherite_scrap 1"
- "broadcast &6%player% &7hit the jackpot!"
分隔线
标题和分隔条使用 %fill% 和 %divider% 代替手动计数的空格。它们以字体像素为单位测量,因此无论标题多长,每个游戏的头部和尾部行都结束于完全相同的位置:
announce:
- "<gold><bold>UNSCRAMBLE!</bold> %fill%"
- "<gray>Unscramble this word:"
- "<yellow><bold>%scrambled%</bold>"
- "%divider%"
存储
统计数据和静音开关存储在数据库中,而非扁平文件。JDBC 驱动程序由 Paper 在首次启动时下载,因此无需额外安装:
storage:
type: sqlite # sqlite, h2, mysql, mariadb or yaml
table-prefix: chatgames_
表会自动创建。如果切换到 MySQL 或 MariaDB,请运行 /chatgames storage 测试连接——它会报告连接时间、服务器版本以及真实的读写往返测试。
附加信息
依赖项
兼容性
- Paper 1.21 - 1.21.8(包括 Purpur 等 Paper 分支)
- Java 21 或更高版本
- 不支持 Spigot 或 CraftBukkit
- 尚未支持 Folia
安装
- 下载插件
- 将下载的 .jar 文件放入你的 plugins 文件夹
- 重启服务器(请勿使用 /reload 或 PlugMan 等任何插件管理器)
- 享受吧!
默认 config.yml
# 自动开始回合。设置为 false 则仅通过 /chatgames start 运行游戏。
auto-start: true
# 回合之间的随机延迟。
interval:
min-seconds: 300
max-seconds: 600
# 自动开始前所需的在线玩家数量。
min-online-players: 1
# 在这些世界中,游戏永不广播且不接受回答。
disabled-worlds: []
# 当为 true 时,只有拥有 chatgames.play 权限的玩家才能回答。
require-play-permission: false
# 当为 true 时,只有拥有 chatgames.receive 权限的玩家才能看到广播。
require-receive-permission: false
# 允许使用 /chatgames toggle 让玩家静音游戏。
allow-toggle: true
# 将广播镜像到服务器控制台。
log-to-console: false
chat:
# 从公共聊天中隐藏胜利消息。
cancel-winning-message: true
# 从公共聊天中隐藏错误答案。对于 hotcold 很有用,对其他游戏则显得嘈杂。
cancel-wrong-answers: false
# 默认奖励,当某个游戏没有自己的奖励时使用。
default-rewards:
commands:
- chance: 1.0
commands:
- "give %player% diamond 1"
- chance: 0.1
commands:
- "give %player% diamond_block 1"
声音:
开始:
启用:true
音效:"minecraft:block.note_block.pling"
音量:1.0
音调:1.2
胜利:
启用:true
音效:"minecraft:entity.player.levelup"
音量:1.0
音调:1.0
超时:
启用:true
音效:"minecraft:block.note_block.bass"
音量:1.0
音调:0.8
错误:
启用:true
音效:"minecraft:block.note_block.didgeridoo"
音量:1.0
音调:0.6
统计:
启用:true
排行榜大小:10
保存间隔(分钟):5
存储:
类型:sqlite
文件:stats.db
表前缀:chatgames_
连接超时(秒):5
mysql:
主机:localhost
端口:3306
数据库:minecraft
用户名:root
密码:""
属性:"?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=utf8&useUnicode=true"
mariadb:
主机:localhost
端口:3306
数据库:minecraft
用户名:root
密码:""
属性:"?useSSL=false&characterEncoding=utf8&useUnicode=true"
示例游戏配置 (games/unscramble.yml)
enabled: true
display-name: "Unscramble"
weight: 1.0
timeout-seconds: 45
max-attempts: 0 # 0 = 每个玩家无限次猜测
answer:
ignore-case: true
ignore-spaces: false
show-hint: true
hint-letters: 1
words:
- diamond
- creeper
- enderman
- redstone
# ...默认包含120个单词
announce:
- "<gold><bold>UNSCRAMBLE!</bold> %fill%"
- "<gray>打乱这个单词:"
- "<yellow><bold>%scrambled%</bold> <dark_gray>(<gray>%length% letters<dark_gray>)"
- "<gray>在聊天中输入你的答案,限时 <white>%timeout%s<gray>!"
- "%divider%"
win-message:
- "<green><bold>%player%</bold> <gray>在 <yellow>%time%s<gray> 内解出了 <white>%word% <gray>!"
timeout-message:
- "<red>没有人解开。答案是 <white>%word%<red>。"
rewards:
commands:
- chance: 1.0
commands:
- "give %player% diamond 1"
Features
- 9 different minigames, all of them can be turned on or off individually
- Fully customizable, every word list, question, message and reward is in the config
- Rounds start on their own on a random interval, or on command
- Reward groups with chances, so a win can pay a base reward plus a rare bonus
- Win stats, personal bests and leaderboards, stored in SQLite, H2, MySQL or MariaDB
- Players who don't want the games can mute them with a single command
- Won't cause lag, everything is cached in memory and saved off the main thread
- MiniMessage support (legacy
& codes work too)
The Minigames
Unscramble - A scrambled word appears, type it unscrambled
Reverse - A word printed backwards, type it the right way round
Math - Solve a generated math problem, first correct answer wins
Fast Type - Retype a sentence exactly, fastest typist wins
Trivia - 55 Minecraft questions included, each with multiple accepted answers
Reaction - A random token appears, pure reflex
Hot & Cold - Guess the secret number, everyone gets private hot/cold feedback
Item Pick - Click the chat button, find the named item in a full double chest
Lucky Loot - A shared board of chests, one holds the prize, empty ones vanish for everyone
Item Pick sometimes hides the same item 2-3 times and you have to click every copy.
Lucky Loot updates live for every player looking at the board.
Commands & Permissions
Commands
/chatgames (/cg, /minigames) - Open the help menu
/chatgames play - Join the current click-to-play game
/chatgames info - Show the running game or when the next one starts
/chatgames stats [player] - View win statistics
/chatgames top [game] - View the leaderboard
/chatgames toggle - Mute or unmute the minigames
/chatgames start [game] - Start a round now
/chatgames stop - Cancel the running round
/chatgames list - List every minigame and its status
/chatgames storage - Test the statistics database connection
/chatgames reload - Reload all configuration
/chatgames resetstats - Wipe all statistics
Permissions
chatgames.play - Allows answering minigames
chatgames.receive - Allows seeing minigame broadcasts
chatgames.stats - Allows viewing stats and leaderboards
chatgames.toggle - Allows muting the minigames
chatgames.admin - Start, stop, reload, storage test and reset
Preview
Configuration
Every minigame has its own file in plugins/ChatGames/games/, so you can edit one game
without touching the rest. New options added by updates are merged into your files
automatically, your edits are never overwritten.
Rewards
Rewards are a list of groups. Every group rolls its own chance, so a win can hand out
nothing, one group or several:
rewards:
commands:
- chance: 1.0
commands:
- "give %player% diamond 1"
- chance: 0.05
commands:
- "give %player% netherite_scrap 1"
- "broadcast &6%player% &7hit the jackpot!"
Divider lines
Headings and divider bars use %fill% and %divider% instead of hand counted spaces.
They are measured in font pixels, so every game's header and footer line ends at exactly
the same spot no matter how long the title is:
announce:
- "<gold><bold>UNSCRAMBLE!</bold> %fill%"
- "<gray>Unscramble this word:"
- "<yellow><bold>%scrambled%</bold>"
- "%divider%"
Storage
Statistics and mute toggles are stored in a database, not in flat files. The JDBC drivers
are downloaded by Paper on first start, so there is nothing to install:
storage:
type: sqlite # sqlite, h2, mysql, mariadb or yaml
table-prefix: chatgames_
Tables are created automatically. If you switch to MySQL or MariaDB, run
/chatgames storage to test the connection - it reports connect time, server version and
a real write/read round-trip.
Extra Info
Dependencies
Compatibility
- Paper 1.21 - 1.21.8 (and Paper forks like Purpur)
- Java 21 or newer
- Does not work on Spigot or CraftBukkit
- Folia is not supported yet
Install
- Download the plugin
- Place the downloaded .jar file into your plugins folder
- Restart your server (Do not use /reload or any plugin manager like PlugMan, etc.)
- Enjoy!
Default config.yml
# Start rounds automatically. Set to false to only run games via /chatgames start.
auto-start: true
# Random delay between rounds.
interval:
min-seconds: 300
max-seconds: 600
# Players needed online before a round starts automatically.
min-online-players: 1
# Worlds where games are never broadcast and never accept answers.
disabled-worlds: []
# When true, only players with chatgames.play may answer.
require-play-permission: false
# When true, only players with chatgames.receive see the broadcasts.
require-receive-permission: false
# Allow /chatgames toggle so players can mute the games.
allow-toggle: true
# Mirror broadcasts into the server console.
log-to-console: false
chat:
# Hide the winning message from public chat.
cancel-winning-message: true
# Hide wrong guesses from public chat. Useful for hotcold, noisy for the rest.
cancel-wrong-answers: false
# Fallback rewards, used when a game has no rewards of its own.
default-rewards:
commands:
- chance: 1.0
commands:
- "give %player% diamond 1"
- chance: 0.1
commands:
- "give %player% diamond_block 1"
sounds:
start:
enabled: true
sound: "minecraft:block.note_block.pling"
volume: 1.0
pitch: 1.2
win:
enabled: true
sound: "minecraft:entity.player.levelup"
volume: 1.0
pitch: 1.0
timeout:
enabled: true
sound: "minecraft:block.note_block.bass"
volume: 1.0
pitch: 0.8
wrong:
enabled: true
sound: "minecraft:block.note_block.didgeridoo"
volume: 1.0
pitch: 0.6
stats:
enabled: true
leaderboard-size: 10
save-interval-minutes: 5
storage:
type: sqlite
file: stats.db
table-prefix: chatgames_
connect-timeout-seconds: 5
mysql:
host: localhost
port: 3306
database: minecraft
username: root
password: ""
properties: "?useSSL=false&allowPublicKeyRetrieval=true&characterEncoding=utf8&useUnicode=true"
mariadb:
host: localhost
port: 3306
database: minecraft
username: root
password: ""
properties: "?useSSL=false&characterEncoding=utf8&useUnicode=true"
Example game config (games/unscramble.yml)
enabled: true
display-name: "Unscramble"
weight: 1.0
timeout-seconds: 45
max-attempts: 0 # 0 = unlimited guesses per player
answer:
ignore-case: true
ignore-spaces: false
show-hint: true
hint-letters: 1
words:
- diamond
- creeper
- enderman
- redstone
# ...120 words included by default
announce:
- "<gold><bold>UNSCRAMBLE!</bold> %fill%"
- "<gray>Unscramble this word:"
- "<yellow><bold>%scrambled%</bold> <dark_gray>(<gray>%length% letters<dark_gray>)"
- "<gray>Type your answer in chat within <white>%timeout%s<gray>!"
- "%divider%"
win-message:
- "<green><bold>%player%</bold> <gray>unscrambled <white>%word% <gray>in <yellow>%time%s<gray>!"
timeout-message:
- "<red>Nobody solved it. The word was <white>%word%<red>."
rewards:
commands:
- chance: 1.0
commands:
- "give %player% diamond 1"
评论 0
登录后参与评分
还没有评论,来抢沙发吧