Container Data Dumper
概念
本模组允许你将容器(如箱子、 barrels、潜影盒等)的内容以 数据组件(SNBT)的形式直接复制到剪贴板。它在容器界面中添加了一个便捷的“复制”按钮,非常适合开发者、技术型玩家或任何需要提取库存数据的用户。
该模组适用于 任何拥有容器库存的方块或实体——包括箱子、 barrel、潜影盒、漏斗、熔炉、酿造台、船箱、漏斗矿车等。
版本兼容性与数据格式
支持版本: Minecraft 1.20 - 1.21.11
⚠️ 关于数据格式的重要说明
此模组 始终 使用 数据组件 格式(Minecraft 1.20.5 引入)输出物品数据。
- 如果你在 Minecraft 1.21+ 上游玩,这是标准格式。
- 如果你在 Minecraft 1.20 - 1.20.4(NBT 为标准格式)上游玩,模组仍会 输出数据组件格式(它不会从较旧的 NBT 结构进行转换——而是直接生成现代格式)。
这确保了无论你在哪个版本下捕获数据,输出都是一致且面向未来的。
关于槽位索引的说明: 此模组使用 存储/NBT 索引(而非 GUI 索引)作为槽位编号。这是用于命令、数据包和 NBT 数据的正确格式。有关 GUI 索引与存储索引之间差异的更多信息,请参阅 槽位索引文档。
输出示例
以下是复制的数据外观示例(数据组件格式):
[
{
"slot": 0,
"item": {
"id": "minecraft:netherite_sword",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 1,
"item": {
"id": "minecraft:netherite_chestplate",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 26,
"item": {
"id": "minecraft:jungle_log",
"count": 1
}
}
]
1.20.5+ 的使用技巧
重要提示: 由于聊天字符限制,通过此模组复制的数据通常太长,无法直接在聊天窗口中粘贴用于命令。
你通常需要必须使用命令方块来执行包含此数据的命令。
使用示例
要给自己一个包含导出数据的箱子,请在命令方块中使用以下语法:
/give @a chest[container=<在此处粘贴你复制的数据>]
这些图片也可能有所帮助:
这将转换为:
[
{
"slot": 0,
"item": {
"id": "minecraft:netherite_sword",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 1,
"item": {
"id": "minecraft:netherite_chestplate",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 26,
"item": {
"id": "minecraft:jungle_log",
"count": 64
}
}
]
Container Data Dumper
Concept
This mod allows you to easily copy the contents of containers (like Chests, Barrels, Shulker Boxes, etc.) in the form of Data Components (SNBT) directly to your clipboard. It adds a convenient "Copy" button to the container UI, making it perfect for developers, technical players, or anyone who needs to extract inventory data.
The mod works with any block or entity that has a container inventory - including Chests, Barrels, Shulker Boxes, Hoppers, Furnaces, Brewing Stands, Chest Boats, Hopper Minecarts, and more.
Version Compatibility & Data Format
Supported Versions: Minecraft 1.20 - 1.21.11
⚠️ Important Note on Data Format
This mod always outputs item data using the Data Components format (introduced in Minecraft 1.20.5).
- If you are playing on Minecraft 1.21+, this is the standard format.
- If you are playing on Minecraft 1.20 - 1.20.4 (in which NBT is the standard format), the mod will still output Data Component format (it does NOT convert from the older NBT structure - it directly generates the modern format).
This ensures that the output is consistent and future-proof, regardless of which version you are currently using to capture the data.
Note on Slot Indices: This mod uses Storage/NBT indices (not GUI indices) for slot numbers. This is the correct format for use in commands, datapacks, and NBT data. For more information about the difference between GUI and Storage indices, see the Slot Index Documentation.
Output Example
Here is an example of what the copied data looks like (Data Components format):
[
{
"slot": 0,
"item": {
"id": "minecraft:netherite_sword",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 1,
"item": {
"id": "minecraft:netherite_chestplate",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 26,
"item": {
"id": "minecraft:jungle_log",
"count": 1
}
}
]
Usage Tip for 1.20.5+
IMPORTANT: Due to chat character limitations, the data copied by this mod is often too long to be pasted directly into the chat window when used in commands.
You typically MUST use a Command Block to execute commands with this data.
Usage Example
To give yourself a chest containing the dumped data, use the following syntax in a command block:
/give @a chest[container=<PASTE_YOUR_COPIED_DATA_HERE>]
This images may also help:
This converts to:
[
{
"slot": 0,
"item": {
"id": "minecraft:netherite_sword",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 1,
"item": {
"id": "minecraft:netherite_chestplate",
"count": 1,
"components": {
"minecraft:enchantments": {
"minecraft:unbreaking": 3
}
}
}
},
{
"slot": 26,
"item": {
"id": "minecraft:jungle_log",
"count": 64
}
}
]
评论 0
登录后参与评分
还没有评论,来抢沙发吧