EntityLogger
用于 Minecraft 的实时实体追踪与世界状态监控,专为机器人自动化和外部工具优化。
? 此模组功能
EntityLogger 持续监控你的 Minecraft 世界,并将所有相关的实体数据记录到高速 SQLite 数据库中。非常适合创建需要实时访问游戏状态信息的 AI 机器人、自动化脚本或分析工具。
✨ 主要特性
? 三个组织良好的数据表
1. 怪物追踪 (monsters 表)
- 记录你周围的所有敌对生物
- 追踪名称、精确坐标 (x, y, z)
- 计算与玩家的距离
- 记录生命值
- 包含唯一 UUID 用于识别
2. 玩家追踪 (players 表)
- 监控区域内的所有玩家(包括你自己)
- 提供与怪物相同的详细信息
- 非常适合多人游戏协作
3. 世界状态 (world_time 表)
- 当前游戏天数和刻数
- 月亮相位信息(对生物生成很重要!)
- 人类可读的时间格式:
"Tag 5, Zeit: 14567 ticks, Mondphase: Vollmond 8/8"
⚡ 性能优化
- 高速更新:数据库每秒刷新两次(每 10 刻)
- 启用 WAL 模式:无数据库锁定——读取时模组正在写入
- 基于快照:始终获取最新数据,无历史杂乱信息
- 批量操作:高效的 SQL 事务以最小化开销
- 并发访问:Python/Java 脚本可实时读取数据库
? 专为机器人脚本设计
该模组专门针对自动化进行设计:
- 清晰的数据结构 - 易于解析和查询
- 无需担心时间戳 - 始终是新鲜快照
- 包含距离计算 - 自动优先处理威胁
- 可靠的更新 - 一致的 10 刻刷新周期
? 包含内容
模组会自动创建 logs/minecraft_entities.db,其中包含三个简单的表:
-- 示例:获取最近的怪物
SELECT name, x, y, z, distance_to_player
FROM monsters
ORDER BY distance_to_player ASC
LIMIT 5;
-- 示例:查找所有玩家
SELECT name, x, y, z FROM players;
-- 示例:当前游戏时间
SELECT game_day, game_ticks, moon_phase
FROM world_time WHERE id = 1;
? 使用场景
- 战斗机器人:自动追踪并响应附近的威胁
- 多人游戏协作:监控队友位置
- 数据分析:研究生物生成模式和玩家行为
- 自动化脚本:构建自玩 Minecraft 机器人
- 外部仪表板:创建实时监控界面
- 机器学习:收集 AI 模型的训练数据
? 技术细节
- 仅客户端 - 无需安装服务器端
- 轻量级 - 对性能影响极小
- SQLite 数据库 - 无需外部数据库服务器
- Fabric 模组 - 需要 Fabric Loader 和 Fabric API
依赖要求
? 怪物列表
追踪所有敌对生物,包括:
- 基础:Zombie, Skeleton, Creeper, Spider, Witch, Slime
- 下界:Blaze, Wither Skeleton, Magma Cube, Hoglin, Piglin variants
- 海洋:Drowned, Guardian, Elder Guardian
- 灾厄村民:Pillager, Vindicator, Evoker, Ravager, Vex
- 特殊:Warden, Breeze, Shulker, Silverfish
- 排除:Enderman, Zombified Piglin, Ghast(未来版本中可配置)
? 入门指南
- 为 Minecraft 1.21.8 安装 Fabric Loader
- 下载并安装 Fabric API 0.133.4+1.21.8
- 将 EntityLogger 放入你的
mods 文件夹
- 启动 Minecraft
- 在
logs/minecraft_entities.db 找到数据库
- 开始构建你的自动化脚本!
? Python 集成示例
import sqlite3
import time
# 连接数据库
conn = sqlite3.connect('logs/minecraft_entities.db')
cursor = conn.cursor()
while True:
# 获取最近的怪物
cursor.execute("""
SELECT name, distance_to_player
FROM monsters
ORDER BY distance_to_player ASC
LIMIT 1
""")
result = cursor.fetchone()
if result:
print(f"Warning! {result[0]} at {result[1]:.1f} blocks away!")
time.sleep(0.5) # 每秒检查两次
? 社区与支持
欢迎提出功能请求!如果你正在构建自动化工具并需要记录其他数据,请随时建议改进。
许可证: MIT
支持: Minecraft 1.21.8 (Fabric)
依赖项: Fabric API 0.133.4+1.21.8(必需)
Java: 17+
EntityLogger
Real-time entity tracking and world state monitoring for Minecraft, optimized for bot automation and external tools.
? What does this mod do?
EntityLogger continuously monitors your Minecraft world and logs all relevant entity data to a fast SQLite database. Perfect for creating AI bots, automation scripts, or analytics tools that need real-time access to game state information.
✨ Key Features
? Three Organized Data Tables
1. Monster Tracking (monsters table)
- Logs all hostile mobs in your vicinity
- Tracks name, exact coordinates (x, y, z)
- Calculates distance to player
- Records health values
- Includes unique UUID for identification
2. Player Tracking (players table)
- Monitors all players in the area (including yourself)
- Same detailed information as monsters
- Perfect for multiplayer coordination
3. World State (world_time table)
- Current game day and tick count
- Moon phase information (important for mob spawning!)
- Human-readable time format:
"Tag 5, Zeit: 14567 ticks, Mondphase: Vollmond 8/8"
⚡ Performance Optimized
- High-speed updates: Database refreshes 2x per second (every 10 ticks)
- WAL mode enabled: No database locking - read while the mod writes
- Snapshot-based: Always current data, no historical clutter
- Batch operations: Efficient SQL transactions for minimal overhead
- Concurrent access: Python/Java scripts can read database in real-time
? Perfect for Bot Scripts
The mod is specifically designed for automation:
- Clean data structure - Easy to parse and query
- No timestamps to worry about - Always fresh snapshots
- Distance calculations included - Prioritize threats automatically
- Reliable updates - Consistent 10-tick refresh cycle
? What’s Included
The mod automatically creates logs/minecraft_entities.db with three simple tables:
-- Example: Get nearest monsters
SELECT name, x, y, z, distance_to_player
FROM monsters
ORDER BY distance_to_player ASC
LIMIT 5;
-- Example: Find all players
SELECT name, x, y, z FROM players;
-- Example: Current game time
SELECT game_day, game_ticks, moon_phase
FROM world_time WHERE id = 1;
? Use Cases
- Combat Bots: Automatically track and respond to nearby threats
- Multiplayer Coordination: Monitor teammate positions
- Analytics: Study mob spawning patterns and player behavior
- Automation Scripts: Build self-playing Minecraft bots
- External Dashboards: Create real-time monitoring interfaces
- Machine Learning: Collect training data for AI models
? Technical Details
- Client-side only - No server installation needed
- Lightweight - Minimal performance impact
- SQLite database - No external database server required
- Fabric mod - Requires both Fabric Loader and Fabric API
Requirements
? Monster List
Tracks all hostile mobs including:
- Basic: Zombie, Skeleton, Creeper, Spider, Witch, Slime
- Nether: Blaze, Wither Skeleton, Magma Cube, Hoglin, Piglin variants
- Ocean: Drowned, Guardian, Elder Guardian
- Illagers: Pillager, Vindicator, Evoker, Ravager, Vex
- Special: Warden, Breeze, Shulker, Silverfish
- Excludes: Enderman, Zombified Piglin, Ghast (configurable in future versions)
? Getting Started
- Install Fabric Loader for Minecraft 1.21.8
- Download and install Fabric API 0.133.4+1.21.8
- Drop EntityLogger into your
mods folder
- Launch Minecraft
- Find the database at
logs/minecraft_entities.db
- Start building your automation scripts!
? Example Python Integration
import sqlite3
import time
# Connect to the database
conn = sqlite3.connect('logs/minecraft_entities.db')
cursor = conn.cursor()
while True:
# Get nearest monster
cursor.execute("""
SELECT name, distance_to_player
FROM monsters
ORDER BY distance_to_player ASC
LIMIT 1
""")
result = cursor.fetchone()
if result:
print(f"Warning! {result[0]} at {result[1]:.1f} blocks away!")
time.sleep(0.5) # Check twice per second
? Community & Support
This mod is open for feature requests! If you’re building automation tools and need additional data logged, feel free to suggest improvements.
License: MIT
Supports: Minecraft 1.21.8 (Fabric)
Dependencies: Fabric API 0.133.4+1.21.8 (Required)
Java: 17+
评论 0
登录后参与评分
还没有评论,来抢沙发吧