Block Image Dumper
一款适用于 Minecraft 26.1 的 Fabric 客户端模组,可将游戏渲染出的图标直接导出为 PNG 文件——无需手动截图、裁剪或清理透明背景。
- F7 — 物品。将每个注册物品的库存图标写入干净、透明的 64×64 PNG(每个物品一个文件)。
- F8 — 装饰。导出平面图标无法捕捉的叠加层:按面绘制的 装饰陶罐碎片 以及可着色的 旗帜与盾牌图案遮罩。
为什么需要它?
预览容器内容的数据包和资源包——例如 shulker-preview 数据包——需要获取每种物品在库存中显示时的像素级精确图像,包括那些自身没有平面精灵图的方块类物品。手动制作约 1,600 张这样的图片是不现实的。此模组能在数秒内生成整套图片,包含正确的透明度和装饰叠加层,可直接放入构建流程中使用。
不过它并不依赖任何特定的资源包——它只是生成你可以用于图集、维基、网页工具或其他用途的 PNG 文件。
工作原理
Minecraft 26.1 的截图路径会强制将所有像素设置为不透明,因此无法直接读取透明度。该模组通过在单个帧中并排渲染两个图标并合并捕获结果来绕过这一限制:
- 物品分别在 黑色 背景和 白色 背景下绘制;对比两者即可重建精确的逐像素 Alpha 通道。
- 陶罐通过对比普通陶罐和带有碎片的陶罐来隔离碎片图案。
- 旗帜与盾牌在 黑色基底 上使用 白色染料 渲染图案,因此亮度差异会形成可着色的白色遮罩。
使用方法
- 将本模组与 Fabric API 一同安装。
- 加载任意世界,然后按下 F7(物品)或 F8(装饰)。
- 在
<minecraft>/block-images/ 目录中找到你的 PNG 文件。
仅客户端 · MIT 许可 · GitHub 上的源代码与发布版本
Block Image Dumper
A Fabric client mod for Minecraft 26.1 that exports the game's rendered icons straight to PNG files — no manual screenshotting, cropping, or transparency cleanup.
- F7 — items. Writes every registered item's inventory icon as a clean, transparent 64×64 PNG (one file per item).
- F8 — decorations. Exports the overlays a flat icon can't capture: per-face decorated-pot sherds and tintable banner & shield pattern masks.
Why would I want this?
Data packs and resource packs that preview container contents — like the shulker-preview data pack — need a pixel-accurate image of every item exactly as it appears in the inventory, including block-type items that have no flat sprite of their own. Producing ~1,600 of those by hand is impractical. This mod generates the entire set in seconds, with correct transparency and decoration overlays, ready to drop into a build pipeline.
It has no dependency on any particular pack, though — it just writes PNGs you can use for atlases, wikis, web tools, or anything else.
How it works
Minecraft 26.1's screenshot path force-sets every pixel opaque, so transparency can't be read back directly. The mod works around this by rendering two icons side by side in a single frame and combining the captures:
- Items are drawn over black and over white; comparing the two reconstructs exact per-pixel alpha.
- Pots compare a plain pot against a one-sherd pot to isolate the sherd motif.
- Banners & shields render the pattern in white dye over a black base, so the brightness difference becomes a tintable white mask.
Usage
- Install this mod alongside Fabric API.
- Load any world, then press F7 (items) or F8 (decorations).
- Find your PNGs in
<minecraft>/block-images/.
Client-side only · MIT licensed · Source & releases on GitHub
评论 0
登录后参与评分
还没有评论,来抢沙发吧