PlayerActionLogger (PAL)
PAL 将 你的 玩家行为记录到一个结构化文件中,专为供 LLM(大型语言模型)读取而设计,以便它能实时解说你的游戏过程。它还附带一个可选的 Python 机器人,可以大声朗读解说内容。
它 仅适用于客户端:在单人游戏中或任何服务器上均可使用;服务器端不需要它,且它只记录你自己的玩家行为。
如果你用它制作了视频,请注明该项目。
日志长什么样
每个事件都是一行 JSON 数据,并带有等级标记,以便读者能区分紧急状况与背景噪音:

| 等级 |
含义 |
INFO |
背景信息。挖矿、行走、风景、命令等 |
NOTABLE |
值得提及的事件。击杀、进度达成、聊天、受到伤害等 |
CRITICAL |
正在发生的情况。死亡、低生命值、岩浆、身后有苦力怕等 |
这个等级的设定是整个项目的核心:正是它让解说者能够在苦力怕出现时插话,而在挖掘第 200 个石块时保持安静。
追踪的内容
- 生命体征 — 生命值、饥饿值、护甲、经验值、状态效果,以及它们何时变得危险
- 战斗 — 你击杀了什么、什么杀死了你、受到的伤害及其来源
- 挖矿 — 矿物发现、会话摘要、实际挖掘过的方块
- 建造与容器 — 放置方块、箱子、工作台、合成
- 危险 — 敌对生物逼近、岩浆、高空坠落、溺水
- 世界 — 生物群系、维度、一天中的时间、天气、高度
- 进度 — 进度达成、等级提升、原版统计数据
- 聊天 — 你说的话、别人说的话、你执行的命令
实时状态,而非仅历史记录
除了日志之外,该模组每秒重写一次 player_state.json —— 日志记录的是 发生了什么,而这个文件反映的是 当前真实的状态:

生命值、位置、装备耐久度、完整物品栏以及原版统计数据。这意味着玩家无需重新回放整个日志,就能回答诸如“我因岩浆死亡了多少次”或“我现在手里拿着什么”之类的问题。
伴生机器人(可选)
该模组本身已具备实用性——任何能够读取 JSONL 格式的工具都可以使用它。但仓库中还提供了一个 Python 机器人,它会读取日志,将其发送给 Gemini,并通过本地 Web 仪表盘朗读回复:

实时生命值、使用真实物品图标绘制的物品栏(包含模组物品——纹理直接从你已有的 JAR 文件中读取)、事件流、API 配额,以及解说员的启动/停止控制。它仅在 127.0.0.1 上运行。
版本
| Minecraft |
加载器 |
依赖项 |
| 26.1.2 |
Fabric |
Fabric API |
| 1.21.11 |
Fabric |
Fabric API |
| 1.21.1 |
Fabric |
Fabric API |
| 1.21.1 |
NeoForge 21.1 |
无其他依赖 |
NeoForge 版本无需额外依赖——它使用 NeoForge 自身的事件系统,因此可直接放入整合包中,不会引入其他任何内容。
所有构建版本均为同一模组、同一版本号:功能集一致,无论选择哪个 jar 文件。
使用方法
- 为你的 Minecraft 版本安装 Fabric(如果是 NeoForge 构建版,则安装 NeoForge)。
- 在 Fabric 上安装 Fabric API。
- 将对应的 jar 文件放入
mods/ 目录——文件名会标明它适用于哪个游戏和加载器。
- 开始游玩。加入世界后即可开始记录日志。
文件存放位置: <你的 Minecraft 文件夹>/logs/player_actions/
— session.log 用于记录事件,player_state.json 用于实时快照。
为什么
它原本是为 LLM 评论而设计的——让你在玩游戏时让某些东西对你的游戏行为做出反应——但日志是纯 JSONL 格式,没有任何与 AI 相关的特殊内容,因此它同样适用于游戏过程追踪、统计数据,或任何其他需要知道你做了什么的操作。
源码、Python 机器人及问题反馈:
PlayerActionLogger (PAL)
PAL logs what your player does to a structured file, designed to be read by an LLM so it
can commentate your gameplay live. It ships with an optional Python bot that speaks the
commentary out loud.
It is client-side only: it works in singleplayer and on any server, the server does not need
it, and it only ever logs your own player.
If you make a video with it, please credit this project.
What the log looks like
Every event is one JSON line, tagged with a level so a reader can tell an emergency from
background noise:

| Level |
Meaning |
INFO |
Background. Mining, walking, scenery, commands |
NOTABLE |
Worth mentioning. Kills, advancements, chat, damage |
CRITICAL |
Happening now. Deaths, low health, lava, a creeper at your back |
That level is the whole point: it is what lets a commentator interrupt itself for a creeper and
stay quiet through the 200th stone block.
What it tracks
- Vitals — health, hunger, armour, XP, status effects, and when any of them turn dangerous
- Combat — what you killed, what killed you, damage taken and where it came from
- Mining — ore finds, session summaries, what you actually dug through
- Building and containers — placement, chests, workstations, crafting
- Danger — hostile mobs closing in, lava, long falls, drowning
- World — biome, dimension, time of day, weather, height
- Progress — advancements, level ups, vanilla statistics
- Chat — what you say, what others say, commands you run
Live state, not just history
Alongside the log, the mod rewrites player_state.json every second — the log says what
happened, this says what is true right now:

Vitals, position, equipment with durability, the full inventory and your vanilla statistics. It
means a reader can answer "how many times have I died to lava" or "what am I holding" without
replaying the whole log.
The companion bot (optional)
The mod is useful on its own — anything that can read JSONL can use it. But the repository also
has a Python bot that reads the log, sends it to Gemini and speaks the reply out loud, with a
local web dashboard:

Live vitals, your inventory drawn with real item icons (modded items included — the textures are
read from the jars you already have), the event feed, API quotas, and start/stop for the
commentator. It runs on 127.0.0.1 only.
Versions
| Minecraft |
Loader |
Needs |
| 26.1.2 |
Fabric |
Fabric API |
| 1.21.11 |
Fabric |
Fabric API |
| 1.21.1 |
Fabric |
Fabric API |
| 1.21.1 |
NeoForge 21.1 |
nothing else |
The NeoForge build as no dependency — it uses NeoForge's own events, so it drops
straight into a modpack without dragging anything else in.
All builds are the same mod at the same version number: one feature set, whichever jar you take.
How to use
- Install Fabric (or NeoForge for the NeoForge build) for your Minecraft version.
- On Fabric, install Fabric API.
- Drop the matching jar into
mods/ — the file name tells you which game and loader it is for.
- Play. Logging starts as soon as you join a world.
Where the files go: <your minecraft folder>/logs/player_actions/
— session.log for the events, player_state.json for the live snapshot.
Why
It was built for LLM commentary — having something react to your gameplay while you play — but
the log is plain JSONL with nothing AI-specific about it, so it works just as well for gameplay
tracking, stats, or anything else that wants to know what you did.
Source, the Python bot and issues:
评论 0
登录后参与评分
还没有评论,来抢沙发吧