MC Stats Mod
一个服务端的 Fabric 模组,用于追踪玩家统计数据并将其推送到外部数据库。兼容原版客户端——玩家无需安装任何内容。
它追踪哪些数据
- 所有原版统计:破坏/放置的方块、使用/合成的物品、击杀、死亡、伤害、移动距离、游戏时长等。
- 自然生成的矿石:区分由世界生成产生的方块和由玩家放置的方块。任务系统无法通过放置并重新挖掘圆石来作弊。
- 自定义统计:按原因分类的死亡次数、附魔操作次数、访问过的独特生物群系数量、图腾使用次数、睡眠次数、单次最高伤害等。
数据发送位置
在配置文件中选择一项:
| 后端 |
用途 |
logging |
测试用途 —— 打印到服务器控制台 |
sqlite |
单服务器设置,零配置 |
mysql |
跨多个服务共享数据 |
webhook |
自定义仪表盘、Discord 机器人、分析工具 —— 向任意 URL 发送 JSON POST 请求 |
安装步骤
- 将 jar 文件放入服务器的
mods/ 文件夹中(与 Fabric API 一起)。
- 启动服务器一次 —— 它会生成
config/mcstats.json。
- 编辑配置文件,然后重启服务器。
就这么简单。默认配置会将日志输出到控制台,以便你在连接数据库之前验证其是否正常工作。
为什么不用 Discord 统计模组?
大多数统计模组都绑定于单一输出端(特定的 Discord 机器人或特定的覆盖层)。而这个模组提供的是中性推送——你的端点接收 JSON 数据,由你决定如何使用。你可以构建排行榜网站、Grafana 仪表盘、任务插件或 MMO 经济追踪器——该模组并不关心具体用途。
链接
MC Stats Mod
A server-side Fabric mod that tracks player statistics and pushes them to an external database. Works with vanilla clients — players don't install anything.
What it tracks
- All vanilla stats: blocks broken/placed, items used/crafted, kills, deaths, damage, movement, time played, etc.
- Natural-mined blocks: distinguishes blocks broken from world generation vs. blocks placed by players. Quest systems can't be cheesed by placing and re-mining cobblestone.
- Custom stats: deaths by cause, enchantments performed, unique biomes visited, totem uses, sleep count, highest single hit.
Where it sends data
Pick one in the config:
| Backend |
Use for |
logging |
Testing — prints to server console |
sqlite |
Single-server setup, zero config |
mysql |
Sharing data across multiple services |
webhook |
Custom dashboards, Discord bots, analytics — POSTs JSON to any URL |
Setup
- Drop the jar in your server's
mods/ folder (alongside Fabric API).
- Start the server once — it generates
config/mcstats.json.
- Edit the config, restart.
That's it. Default config logs to console so you can verify it's working before wiring up a database.
Why use this instead of a Discord-stats mod?
Most stat mods are coupled to one output (a specific Discord bot, a specific overlay). This one is a neutral push — your endpoint receives JSON, you decide what to do with it. Build a leaderboard site, a Grafana dashboard, a quest plugin, an MMO economy tracker — the mod
doesn't care.
Links
- Full documentation, config reference, troubleshooting: GitHub
- Issues / feature requests: GitHub Issues
- License: CC0 1.0 — public domain.
评论 0
登录后参与评分
还没有评论,来抢沙发吧