Item Finder
开发中 — 该模组功能可用,但仍处于早期开发阶段。可能会出现粗糙之处、缺失的功能和错误。性能目前并非优先考虑的因素,在某些情况下可能会明显较差。
AI 辅助披露 — 该模组的某些部分是在 AI 工具(Claude)的帮助下开发的。代码已经过审查和测试,但请留意这一点。
这是一个适用于 Minecraft 1.21/1.21.1 的客户端 Fabric 模组,可帮助你在附近的容器中找到存储的物品。当你打开容器时,它会缓存容器的物品栏,并在 HUD 上显示持有你目标物品的最近容器,同时在世界中渲染彩色轮廓。
工作原理
Item Finder 仅支持客户端 — 它不需要服务器端组件,既可以在单人游戏中使用,也可以在多人游戏中使用。代价是,容器必须至少被访问过一次才会出现在搜索结果中。当你打开一个容器时,其内容会自动被记录。当你关闭它时,缓存会更新并立即运行新的搜索。
后台定期搜索每 N 个刻(可配置)重新运行一次,以便在你移动时保持距离信息的准确性。
服务器支持(可选)
为了在服务器上获得更好的体验,可以将 Litematica 与 Item Finder 一起安装在客户端。当存在 Litematica 时,它可以查找玩家附近容器中的物品,而无需手动打开每一个。
然而,这需要在服务器上安装 Servux,并在 Servux 的服务器端配置中启用 entityDataSync 选项。如果没有这些,则只能使用标准的访问和缓存方法。
功能
HUD 覆盖层
- 显示当前目标物品及其图标
- 显示持有该物品的最近容器的距离(例如
12.5m)
- 显示持有该物品的容器数量(例如
3 boxes)
- 显示你在活动列表中的当前位置(例如
[4/25])
- 颜色编码状态:绿色 = 已找到,红色 = 未找到,灰色 = 已禁用
- 位置可在设置中配置(左上、右上、左下、右下),并且会考虑其他 HUD 元素,不会与原版药水/状态效果区域重叠
世界渲染
- 在世界中绘制最近容器的方框轮廓
- 绿色方框表示当前选中物品的容器
- 可选的穿墙显示模式(在设置中切换)
容器缓存
- 当你打开和关闭容器时,自动记录容器内容
- 为每个槽位存储物品 ID 和数量(不包括你的玩家物品栏)
- 缓存在整个会话期间持久存在;在游戏重启之前,容器将保持被追踪状态
搜索与距离过滤
- 可配置的搜索半径(4–128 格,默认 32)
- 结果按距离排序,最近的优先
- 搜索以可配置的时间间隔自动刷新(1–200 刻,默认 20)
物品列表
- 从
config/itemfinder/lists/ 中的 JSON 文件加载物品列表
- 每个列表都是命名好的物品 ID 集合
- 可以单独切换各个物品的开启/关闭状态;状态会在会话之间按列表保存
- 使用热键导航物品(循环浏览已启用的物品)
- 自动禁用缺失项:禁用在任何缓存容器中未找到的所有物品
- 物品管理器中有全部启用 / 全部禁用按钮
槽位高亮
- 当你打开包含当前目标物品的容器时,匹配的槽位会以绿色高亮显示
- 可在设置中切换
物品管理器 GUI
- 显示活动列表中的所有物品,包括图标、数量、容器数量和最近距离
- 可搜索/过滤的列表
- 单个物品的切换按钮
- 摘要统计信息:总物品数、已启用、已禁用、已找到
文件浏览器
- 浏览并加载
config/itemfinder/lists/ 中的 .json 列表文件
- 支持导航子目录
配置界面
可通过 Mod Menu 或热键访问。两个标签页:
- 通用 — 所有数值和布尔设置
- 热键 — 查看和重新绑定所有按键绑定
按键绑定
| 动作 |
默认按键 |
描述 |
| 打开列表浏览器 |
I |
浏览并加载物品列表文件 |
| 下一个物品 |
N |
循环到下一个启用的物品 |
| 上一个物品 |
B |
循环到上一个启用的物品 |
所有按键绑定都可以在设置屏幕的热键标签页中进行配置。
配置
配置文件:config/itemfinder.json
| 设置 |
默认值 |
范围 |
描述 |
searchRadius |
32 |
4–128 |
包含在结果中的缓存容器的方块半径 |
searchInterval |
20 |
1–200 |
自动搜索刷新之间的刻数 |
showThroughWalls |
false |
— |
穿透实心方块渲染容器轮廓 |
highlightSlots |
true |
— |
在打开的容器中高亮显示匹配的槽位 |
物品列表格式
将 .json 文件放置在 config/itemfinder/lists/ 中。示例:
{
"name": "My List",
"items": [
"minecraft:diamond",
"minecraft:iron_ingot",
"minecraft:oak_log"
]
}
物品 ID 遵循标准的 namespace:item_id 格式。
文件位置
| 文件 |
用途 |
config/itemfinder.json |
主配置文件 |
config/itemfinder/lists/*.json |
物品列表定义 |
config/itemfinder/state.json |
单个物品的启用/禁用状态 |
构建
需要 JDK 21。
./gradlew build
输出的 jar 文件将在 build/libs/ 中。
待办事项
容器与数据
- 改进 Litematica/Servux 集成,以同步玩家周围的容器数据。
有用链接
Fabric 文档
库文件(Minecraft 1.21.11)
-
MaLiLib(分支版本):
-
Servux(分支版本):
Maven 仓库
许可证
LGPLv3 — 详见 LICENSE。
Item Finder
Work In Progress — this mod is functional but still in early development. Expect rough edges, missing features, and bugs. Performance is not a priority yet and may be noticeably poor in some situations.
AI Assistance Disclosure — portions of this mod were developed with the help of AI tools (Claude). The code has been reviewed and tested, but keep that in mind.
A client-side Fabric mod for Minecraft 1.21/1.21.1 that helps you locate items stored in nearby containers. It caches container inventories as you open them and displays a HUD with the nearest container holding your target item, along with colored outlines rendered directly in the world.
How It Works
Item Finder is client-side only — it does not require a server-side counterpart and works on both singleplayer and multiplayer. The trade-off is that containers must be visited at least once before they appear in search results. When you open a container, its contents are automatically recorded. When you close it, the cache is updated and a new search runs immediately.
A periodic background search re-runs every N ticks (configurable) so that distances stay current as you move around.
Server Support (Optional)
For a better experience on servers, Litematica can be installed on the client alongside Item Finder. When Litematica is present, it enables finding items in containers near the player without needing to manually open each one.
However, this requires Servux to be installed on the server and the entityDataSync option to be enabled in the server-side Servux configuration. Without that, only the standard visit-and-cache approach will work.
Features
HUD Overlay
- Displays the current target item with its icon
- Shows the distance to the nearest container holding that item (e.g.
12.5m)
- Shows how many containers hold that item (e.g.
3 boxes)
- Shows your current position in the active list (e.g.
[4/25])
- Color-coded status: green = found, red = not found, gray = disabled
- Possition configurable in settings (top-left, top-right, bottom-left, bottom-right) is aware of other HUD elements and won't overlap the vanilla potions/status effects area etc
World Rendering
- Draws box outlines around the nearest containers in the world
- Green boxes for the currently selected item's containers
- Optional show through walls mode (toggle in settings)
Container Caching
- Automatically records container contents when you open and close them
- Stores item IDs and quantities for every slot (excludes your player inventory)
- Cache persists for the session; containers remain tracked until the game restarts
Search & Distance Filtering
- Configurable search radius (4–128 blocks, default 32)
- Results sorted by distance, nearest first
- Search automatically refreshes on a configurable interval (1–200 ticks, default 20)
Item Lists
- Load item lists from JSON files in
config/itemfinder/lists/
- Each list is a named collection of item IDs
- Toggle individual items on/off; state is saved per list between sessions
- Navigate items with a hotkey (cycles through enabled items)
- Auto-disable missing: disables all items that aren't found in any cached container
- Enable All / Disable All buttons in the item manager
Slot Highlighting
- When you open a container that holds your current target item, matching slots are highlighted in green
- Toggle-able in settings
Item Manager GUI
- Shows all items in the active list with icons, counts, container count, and nearest distance
- Searchable/filterable list
- Per-item toggle buttons
- Summary stats: total items, enabled, disabled, found
File Browser
- Browse and load
.json list files from config/itemfinder/lists/
- Navigates subdirectories
Config Screen
Accessible from Mod Menu or via hotkey. Two tabs:
- Generic — all numeric and boolean settings
- Hotkeys — view and rebind all keybindings
Keybindings
| Action |
Default Key |
Description |
| Open List Browser |
I |
Browse and load an item list file |
| Next Item |
N |
Cycle to the next enabled item |
| Previous Item |
B |
Cycle to the previous enabled item |
All keybindings are configurable in the Hotkeys tab of the settings screen.
Configuration
Config file: config/itemfinder.json
| Setting |
Default |
Range |
Description |
searchRadius |
32 |
4–128 |
Block radius to include cached containers in results |
searchInterval |
20 |
1–200 |
Ticks between automatic search refreshes |
showThroughWalls |
false |
— |
Render container outlines through solid blocks |
highlightSlots |
true |
— |
Highlight matching slots in open containers |
Item List Format
Place .json files in config/itemfinder/lists/. Example:
{
"name": "My List",
"items": [
"minecraft:diamond",
"minecraft:iron_ingot",
"minecraft:oak_log"
]
}
Item IDs follow the standard namespace:item_id format.
File Locations
| File |
Purpose |
config/itemfinder.json |
Main configuration |
config/itemfinder/lists/*.json |
Item list definitions |
config/itemfinder/state.json |
Per-item enabled/disabled state |
Building
Requires JDK 21.
./gradlew build
The output jar will be in build/libs/.
TODO
Container & Data
- Improve Litematica/Servux integration for syncing container data around the player.
Useful Links
Fabric Docs
Libraries (Minecraft 1.21.11)
-
MaLiLib (fork):
-
Servux (fork):
Maven Repositories
License
LGPLv3 — see LICENSE.
评论 0
登录后参与评分
还没有评论,来抢沙发吧