Loot Injector
使用简单的 JSON 配置文件,将自定义战利品注入游戏中的任何箱子——无论是原版还是模组添加的——无需编写代码。
✦ 功能特性
- 注入任意战利品表 —— 地牢、堡垒遗迹、要塞、村庄、沉船、模组结构、生物掉落、钓鱼 loot 等
- 兼容所有模组 —— 使用 Forge 的物品注册表配合多级查找机制,支持来自任何模组的物品
- 加权概率 —— 每个物品拥有独立的掉落几率(0.01%–100%),每次开启箱子时生效
- 浮点数数量 —— 最小/最大堆叠大小接受小数数值(例如
1.5 平均结果为 2)
- 完整的 NBT 支持 —— 可为物品附加任意 SNBT 标签;对于使用带有 NBT 变体的通用物品的模组尤为重要
- 自定义战利品箱 —— 定义命名的箱子配置并通过命令给予玩家;物品在给予时预掷骰子
- 游戏内 GUI 编辑器 —— 浏览、添加、编辑和删除战利品规则,完全无需触碰文件
- 实时 JSON 预览 —— “原始 JSON” 标签页显示您编辑时的确切文件内容
- 热重载 —— 通过
/structureloot reload 应用配置更改,无需重启服务器
- 导入 / 导出 —— 通过
/structureloot export 和 import 将配置集作为 ZIP 配置文件进行分享
- 验证命令 ——
/structureloot validate 扫描所有物品 ID 并即时报告错误
- 调试命令 ——
/structureloot debug items 列出来自任何模组的所有物品;debug item 测试单个查找结果
✦ 工作原理
将 .json 文件放置在 .minecraft/config/structureloot/pools/ 目录下,模组会在运行时将您的物品注入到该战利品表中——无需数据包、无需 /reload、无需重启。
{
"target_loot_table": "minecraft:chests/simple_dungeon",
"enabled": true,
"inject_items": [
{ "item": "minecraft:diamond", "weight": 10.0, "min_count": 1.0, "max_count": 3.0 },
{ "item": "examplemod:rare_sword", "weight": 2.0, "min_count": 1.0, "max_count": 1.0,
"nbt": "{display:{Name:'{\"text\":\"Ancient Blade\"}'}}" }
]
}
weight 字段表示每次开启箱子的百分比几率(而非池权重)。weight: 10.0 意味着每次打开该箱子时有 10% 的几率。
✦ 自定义战利品箱
在 config/structureloot/chests/ 中定义一个命名的箱子配置,并通过命令给予任何玩家:
/structureloot chest get mythic_chest
玩家会收到一个命名的箱子,其中包含预掷好的物品。GUI 允许您管理配置、添加物品、设置投掷次数以及编辑所有内容,而无需直接编辑文件。
✦ 命令
所有命令需要 OP 等级 2。
| 命令 |
描述 |
/structureloot reload |
重新加载所有 JSON 配置 |
/structureloot list |
列出所有活动的池规则 |
/structureloot validate |
检查所有物品 ID 是否存在错误 |
/structureloot export |
将配置导出为 ZIP 文件 |
/structureloot import |
导入 ZIP 配置文件 |
/structureloot chest get |
给予自定义战利品箱 |
/structureloot chest list |
列出所有箱子配置 |
/structureloot debug items |
列出某个模组已注册的物品 |
/structureloot debug item |
测试特定的物品 ID |
✦ GUI 编辑器
通过 K 键绑定打开(可在“控制 → Structure Loot Injector”中重新绑定)。
编辑器提供完整的面板界面:
- 战利品池 —— 管理每个战利品表的注入规则
- 条目标签页 —— 添加/编辑/移除物品,显示权重条和数量范围
- 原始 JSON 标签页 —— 配置文件的实时语法着色视图
- 自定义箱子 —— 管理命名的箱子配置,包括固定掉落和加权随机物品池
✦ 查找物品 ID
- 在游戏中按 F3+H 启用高级工具提示
- 悬停在任意物品上——注册表 ID 将显示在工具提示底部
- 对于基于 NBT 的物品变体模组,还会显示完整的 NBT 标签
或者使用内置命令:
/structureloot debug items
✦ 兼容性
- Minecraft 1.20.1 · Forge 47.2.0+
- 仅服务端(客户端无需安装此模组)
- 兼容所有使用标准 Forge 物品注册的模组
- 使用 Forge 的全局战利品修改器系统——与其他战利品模组无冲突
Loot Injector
Inject custom loot into any chest in the game — vanilla or modded — using simple JSON config files. No coding required.
✦ Features
- Inject into any loot table — dungeons, bastions, strongholds, villages, shipwrecks, modded structures, mob drops, fishing loot, and more
- Works with every mod — uses Forge's item registry with a multi-stage lookup so items from any mod are supported
- Weighted probability — each item has its own independent drop chance (0.01%–100%) per chest opening
- Float counts — min/max stack sizes accept decimal values (e.g.
1.5 averages to 2)
- Full NBT support — attach any SNBT tag to items; required for mods that use generic items with NBT variants
- Custom Loot Chests — define named chest configs and give them to players via command; items are pre-rolled per give
- In-game GUI editor — browse, add, edit, and delete loot rules without ever touching a file
- Live JSON preview — Raw JSON tab shows the exact file content as you edit
- Hot-reload — apply config changes without restarting the server via
/structureloot reload
- Import / Export — share config sets as ZIP profiles with
/structureloot export and import
- Validation command —
/structureloot validate scans every item ID and reports errors instantly
- Debug commands —
/structureloot debug items lists all items from any mod; debug item tests a single lookup
✦ How It Works
Place a .json file in .minecraft/config/structureloot/pools/ and the mod injects your items into that loot table at runtime — no data pack, no /reload, no restart needed.
{
"target_loot_table": "minecraft:chests/simple_dungeon",
"enabled": true,
"inject_items": [
{ "item": "minecraft:diamond", "weight": 10.0, "min_count": 1.0, "max_count": 3.0 },
{ "item": "examplemod:rare_sword", "weight": 2.0, "min_count": 1.0, "max_count": 1.0,
"nbt": "{display:{Name:'{\"text\":\"Ancient Blade\"}'}}" }
]
}
The weight field is a percentage chance per chest opening (not a pool weight). weight: 10.0 means a 10% chance each time that chest is opened.
✦ Custom Loot Chests
Define a named chest config in config/structureloot/chests/ and give it to any player via command:
/structureloot chest get mythic_chest
The player receives a named chest with pre-rolled items inside. The GUI lets you manage configs, add items, set rolls, and edit everything without editing files directly.
✦ Commands
All commands require OP level 2.
| Command |
Description |
/structureloot reload |
Reload all JSON configs |
/structureloot list |
List all active pool rules |
/structureloot validate |
Check all item IDs for errors |
/structureloot export |
Export configs as a ZIP |
/structureloot import |
Import a ZIP profile |
/structureloot chest get |
Give a custom loot chest |
/structureloot chest list |
List all chest configs |
/structureloot debug items |
List registered items from a mod |
/structureloot debug item |
Test a specific item ID |
✦ GUI Editor
Open with the K keybind (rebindable in Controls → Structure Loot Injector).
The editor provides a full three-panel interface:
- Loot Pools — manage injection rules per loot table
- Entries tab — add/edit/remove items with weight bars and count ranges
- Raw JSON tab — live syntax-coloured view of the config file
- Custom Chests — manage named chest configs with guaranteed and weighted random item pools
✦ Finding Item IDs
- Press F3+H in-game to enable advanced tooltips
- Hover over any item — the registry ID appears at the bottom of the tooltip
- For mods with NBT-based item variants, the full NBT tag is also shown
Or use the built-in command:
/structureloot debug items
✦ Compatibility
- Minecraft 1.20.1 · Forge 47.2.0+
- Server-side only (clients do not need the mod installed)
- Compatible with all mods that use standard Forge item registration
- Uses Forge's Global Loot Modifier system — no conflicts with other loot mods
评论 0
登录后参与评分
还没有评论,来抢沙发吧