✅ 适用于 Minecraft Java版 1.20.5+
1. 数据包基础结构与部署
1.1 标准目录树
YourDatapack/
├── pack.mcmeta ← 描述文件
└── data/
└── your_namespace/ ← 命名空间(仅小写字母、数字、下划线)
└── recipes/ ← 配方文件夹
├── shaped_sword.json
├── smelt_iron.json
└── ...
1.2 pack.mcmeta 示例
{
"pack": {
"pack_format": 48,
"description": "自定义配方数据包"
}
}
💡
pack_format速查:1.20.5~1.21.3 = 48|1.21.4 = 52|1.21.5+ = 53。请严格按游戏版本填写。
2. 配方类型 (type) 全览
type 决定了配方使用的处理设备、输入输出逻辑与数据结构。所有值必须带 minecraft: 前缀。
type 值 |
适用设备 | 输入格式 | 输出特性 | 默认耗时 | 经验 |
|---|---|---|---|---|---|
crafting_shaped |
工作台 | pattern + key |
严格按 3×3 网格摆放 | – | – |
crafting_shapeless |
工作台 | ingredients (数组) |
任意顺序/位置摆放 | – | – |
smelting |
熔炉 | ingredient (单对象) |
任意物品 | 200 tick (10s) | ✅ |
blasting |
高炉 | ingredient (单对象) |
仅矿石/金属类 | 100 tick (5s) | ✅ |
smoking |
烟熏炉 | ingredient (单对象) |
仅食物类 | 100 tick (5s) | ✅ |
campfire_cooking |
营火 | ingredient (单对象) |
仅食物,固定产出1个 | 600 tick (30s) | ✅ |
stonecutting |
切石机 | ingredient (单对象) |
消耗1个输入,产出数量由 count 决定 |
– | – |
smithing_transform |
锻造台 | template+base+addition |
物品替换升级(如钻石→下界合金) | – | – |
smithing_trim |
锻造台 | template+base+addition |
为盔甲添加/覆盖纹饰组件(无 result) |
– | – |
3. 各类配方 JSON 模板
3.1 工作台:有序合成 (crafting_shaped)
{
"type": "minecraft:crafting_shaped",
"pattern": [
" A ",
"ABA",
" B "
],
"key": {
"A": { "item": "minecraft:oak_planks" },
"B": { "item": "minecraft:stick" }
},
"result": {
"id": "minecraft:wooden_pickaxe",
"count": 1
}
}
3.2 工作台:无序合成 (crafting_shapeless)
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{ "item": "minecraft:apple" },
{ "item": "minecraft:sugar" }
],
"result": {
"id": "minecraft:golden_apple",
"count": 1
}
}
3.3 烧炼类 (smelting / blasting / smoking / campfire_cooking)
📌 四者结构完全一致,仅
type和默认耗时/适用物品种类不同。
{
"type": "minecraft:smelting",
"ingredient": { "item": "minecraft:raw_iron" },
"result": { "id": "minecraft:iron_ingot" },
"experience": 0.7,
"cookingtime": 200
}
3.4 切石机 (stonecutting)
{
"type": "minecraft:stonecutting",
"ingredient": { "item": "minecraft:stone" },
"result": {
"id": "minecraft:stone_bricks",
"count": 4
}
}
3.5 锻造台:物品升级 (smithing_transform)
{
"type": "minecraft:smithing_transform",
"template": { "item": "minecraft:netherite_upgrade_smithing_template" },
"base": { "item": "minecraft:diamond_chestplate" },
"addition": { "item": "minecraft:netherite_ingot" },
"result": { "id": "minecraft:netherite_chestplate" }
}
3.6 锻造台:盔甲纹饰 (smithing_trim)
⚠️ 无
result字段。配方仅定义允许的组合,实际纹饰效果由物品组件动态计算。
{
"type": "minecraft:smithing_trim",
"template": { "tag": "minecraft:trim_templates" },
"base": { "tag": "minecraft:trimmable_armor" },
"addition": { "tag": "minecraft:trim_materials" }
}
4. 核心字段语法规则
输入物品写法
| 场景 | 写法示例 | 说明 |
|---|---|---|
| 指定物品 | { "item": "minecraft:diamond" } |
精确匹配单个物品ID |
| 使用标签 | { "tag": "minecraft:planks" } |
匹配标签内所有物品 |
| 带组件(1.20.5+) | { "item": "minecraft:potion", "components": { "minecraft:potion_contents": { "potion": "minecraft:fire_resistance" } } } |
替代旧版 NBT,需严格匹配组件结构 |
产物 result 规范 (1.20.5+)
"result": {
"id": "minecraft:stone", // 必须使用 "id" 而非 "item"
"count": 4 // 可选,默认 1
}
💡 若需产物携带自定义名称、附魔等,需通过
components字段声明(1.20.5+ 全面启用数据组件系统)。
可选控制字段
| 字段 | 类型 | 说明 |
|---|---|---|
group |
string |
配方分组。同组配方在 GUI 中可左右循环切换 |
category |
string |
创造模式分类:building/redstone/equipment/misc/food |
show_notification |
boolean |
首次合成时是否弹出“新配方解锁”提示(默认 true) |
experience |
number |
烧炼后给予的经验值(仅烧炼类有效) |
cookingtime |
number |
烧炼耗时(tick)。20 tick = 1 秒 |
5. 版本兼容对照表
| 特性 | 1.20.4 及以前 | 1.20.5+ (当前) |
|---|---|---|
| 产物物品字段 | "item": "minecraft:stone" |
"id": "minecraft:stone" |
| 锻造台类型 | minecraft:smithing (仅 base+addition) |
拆分为 smithing_transform 与 smithing_trim |
| 物品属性修改 | 使用 nbt: "{...}" |
使用 components: { "minecraft:xxx": {...} } |
| 标签写法 | { "tag": "planks" } (可省略命名空间) |
建议写全 { "tag": "minecraft:planks" } |
📌 强烈建议:新数据包一律使用 1.20.5+ 语法。旧语法在新版本加载时会直接报错并忽略配方。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END









暂无评论内容