ChestLootControl
Adds admin commands to clear all chests or fill them with customizable loot and probability in Minecraft worlds.
介绍
ChestLootControl – Chest Loot Control
📖 Introduction
ChestLootControl is a lightweight Fabric admin utility mod that gives you full control over the items inside all chests in the world through simple commands. Clear every container in one go, or randomly refill them with fully customizable items—including full NBT support. Perfect for map makers, server admins, and modpack testing.
✨ Features
One-click container clearing: Use /clearallchests to instantly remove all items from every loaded chest, trapped chest, barrel, and shulker box in the world.
Probability-based item filling: Use /fillchests to randomly fill containers with your choice of items at a custom probability.
Fully customizable items: Specify any vanilla item with a configurable quantity range (e.g., minecraft:diamond:1-3).
Full NBT support: Supports the same NBT format as the /give command—add enchantments, potion effects, custom names, and more.
Instant effect, no reloads: Commands take effect immediately; no server reload or chunk reloading required.
Low performance impact: Only iterates over currently loaded chunks, keeping things lightweight and efficient.
📋 Commands
Command Parameters Description
/clearallchests None Clears all items from every container in all loaded chunks
/fillchests Fills containers with random items at the specified probability
Permission required: Operator (level ≥ 2)
🎮 Usage
Clear all chests
text
/clearallchests
After execution, all loaded chests are emptied instantly. The chat will display the number of containers cleared.
Fill chests with items
Basic usage – plain items
text
/fillchests 0.8 minecraft:diamond:1-3, minecraft:iron_ingot:5-10
This means 80% of chests will randomly receive either diamonds (1–3) or iron ingots (5–10).
Advanced usage – items with NBT
text
/fillchests 0.5 minecraft:diamond_sword:1 {Damage:0,Enchantments:[{id:”minecraft:sharpness”,lvl:3}]}, minecraft:potion:1 {Potion:”minecraft:strong_healing”}
This means 50% of chests will be filled with a Sharpness III diamond sword or an instant health II potion.
Parameter details
Probability: A float between 0.0 and 1.0
0.0 = no chests are modified
0.5 = roughly half of all chests
1.0 = every chest is filled
Item list format:
text
namespace:item_id:min-max [optional NBT]
Multiple items are separated by a comma ,
NBT follows the same syntax as the /give command
Quantities are rolled randomly within the given range
🎯 Use Cases
Adventure map creation – Quickly populate dungeon chests with loot
Server events – Refresh all chests across the server for limited-time events
Survival server management – Periodically clear public chests to prevent item hoarding
Modpack testing – Fill containers with test items without placing them manually
Minigame worlds – Randomize resource distribution for extra replayability
📦 Installation
Install Minecraft 1.20.1 and Fabric Loader 0.14.21 or newer
Install Fabric API
Place the mod’s .jar file into your .minecraft/mods/ folder
Launch the game, enter a world, and use the commands
⚙️ Compatibility
Minecraft: 1.20.1
Mod loader: Fabric 0.14.21+
Required dependency: Fabric API
Dedicated server: ✅ Supported
Singleplayer: ✅ Supported (cheats must be enabled)
📝 Notes
Commands only affect containers in currently loaded chunks. Unloaded areas are not processed.
If the world contains a very large number of chests, consider running commands during low server activity to avoid brief lag.
/fillchests will clear the container’s existing items before refilling it. Use with care.
When using NBT tags, make sure the format is correct; otherwise the item may fail to generate.
🖼️ Screenshots (Suggested)
Clear command feedback Fill command feedback
[Screenshot 1: /clearallchests result] [Screenshot 2: /fillchests result]
[Screenshot 3: Chest before/after clearing] [Screenshot 4: Chest containing NBT items]
❓ FAQ
Q: Some chests weren’t cleared/filled. Why?
A: The command only processes loaded chunks. Move closer to the chests to load their chunks, or use a world preloader mod on servers.
Q: Can I target only a specific area instead of the whole world?
A: The current version works globally. Area-specific targeting is planned for a future update.
Q: Does it support loot tables?
A: Currently, items are defined directly in the command. Loot table integration is on the roadmap.
🔗 Links
Fabric API: https://modrinth.com/mod/fabric-api
📄 License
This project is licensed under the MIT License. You are free to use, modify, and distribute it, as long as you retain the original author notice and release your modifications under the same license.
常见问题
ChestLootControl 支持哪些 Minecraft 版本?
ChestLootControl 支持 Minecraft Java 版 1.20.1–1.20.6,共 6 个版本,可用的加载器:Fabric。下载时注意选择和你游戏版本一致的文件。
ChestLootControl 怎么安装?
先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端 / 服务端。
评论
登录后评论和评分