minecraft-resource-pack

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Minecraft Resource Pack Skill

Minecraft 资源包 Skill

What Is a Resource Pack?

什么是资源包?

A resource pack is a folder (or
.zip
) that overrides or adds Minecraft's visual and audio assets: textures, models, sounds, language files, and fonts. No Java or mod loader is required for those vanilla assets.
资源包是一个文件夹(或
.zip
),用于覆盖或添加 Minecraft 的视觉和音频资源:纹理、模型、声音、语言文件和字体。对于这些原版资源,不需要 Java 或 mod loader。

Routing Boundaries

路由边界

  • Use when
    : the deliverable is visual/audio assets (textures, models, sounds, fonts) in resource-pack format.
  • Do not use when
    : the task requires gameplay logic or runtime behavior changes (use
    minecraft-datapack
    ,
    minecraft-plugin-dev
    , or
    minecraft-modding
    ).
  • Do not use when
    : the task is server infrastructure/runtime administration (
    minecraft-server-admin
    ).

  • Use when
    :交付物采用资源包格式,且为视觉/音频资源(纹理、模型、声音、字体)。
  • Do not use when
    :任务需要更改玩法逻辑或运行时行为(使用
    minecraft-datapack
    、
    minecraft-plugin-dev
    或
    minecraft-modding
    )。
  • Do not use when
    :任务涉及服务器基础设施/运行时管理(
    minecraft-server-admin
    )。

Pack Metadata

资源包元数据

Minecraft VersionPreferred
pack
metadata
1.21 / 1.21.1
pack_format: 34
1.21.2 / 1.21.3
pack_format: 42
1.21.4
pack_format: 46
1.21.5
pack_format: 55
1.21.6
pack_format: 63
1.21.7 / 1.21.8
pack_format: 64
1.21.9 / 1.21.10
min_format: [69, 0]
,
max_format: [69, 0]
1.21.11
min_format: [75, 0]
,
max_format: [75, 0]
26.1
min_format: [84, 0]
,
max_format: [84, 0]
26.2
min_format: [88, 0]
,
max_format: [88, 0]
26.3
min_format: [97, 1]
,
max_format: [97, 1]
Use legacy
pack_format
only for resource formats below 65 (through 1.21.8). Resource format 65 and later require both
min_format
and
max_format
; use
[major, minor]
for exact patch targeting, including
.0
such as
[84, 0]
. An integer or
[major]
min_format
means
[major, 0]
; an integer or
[major]
max_format
permits every minor version on that major line. Do not write decimal JSON numbers. A legacy-only pack can use its integer
pack_format
alone. A range whose
min_format
includes a legacy format needs integer
pack_format
and
supported_formats
; do not include
supported_formats
for a modern-only range.

Minecraft 版本首选
pack
元数据
1.21 / 1.21.1
pack_format: 34
1.21.2 / 1.21.3
pack_format: 42
1.21.4
pack_format: 46
1.21.5
pack_format: 55
1.21.6
pack_format: 63
1.21.7 / 1.21.8
pack_format: 64
1.21.9 / 1.21.10
min_format: [69, 0]
,
max_format: [69, 0]
1.21.11
min_format: [75, 0]
,
max_format: [75, 0]
26.1
min_format: [84, 0]
,
max_format: [84, 0]
26.2
min_format: [88, 0]
,
max_format: [88, 0]
26.3
min_format: [97, 1]
,
max_format: [97, 1]
仅对低于 65 的资源格式(截至 1.21.8)使用旧版
pack_format
。 资源格式 65 及更高版本要求同时设置
min_format
和
max_format
;使用
[major, minor]
精确锁定补丁版本,包括
.0
这类
[84, 0]
。 整数或
[major]
形式的
min_format
表示
[major, 0]
;整数或
[major]
形式的
max_format
允许该主版本系列中的所有次版本。不要 写入小数形式的 JSON 数字。仅支持旧版的资源包可以单独使用整数形式的
pack_format
。如果某个范围的
min_format
包含旧版资源格式,则需要 整数形式的
pack_format
和
supported_formats
;仅包含现代版本的 范围不要添加
supported_formats
。

Directory Layout

目录结构

my-pack/
├── pack.mcmeta
├── pack.png                   ← 64×64 icon (optional)
└── assets/
    └── minecraft/             ← override vanilla (or <namespace>/ for new packs)
        ├── models/
        │   ├── block/
        │   │   └── stone.json
        │   └── item/
        │       └── diamond_sword.json
        ├── items/              ← 1.21.4+ item model definitions
        │   └── diamond_sword.json
        ├── blockstates/
        │   └── stone.json
        ├── textures/
        │   ├── block/
        │   │   └── stone.png
        │   ├── item/
        │   │   └── diamond_sword.png
        │   ├── gui/
        │   │   └── sprites/
        │   │       └── my_sprite.png
        │   └── entity/
        │       └── zombie/
        │           └── zombie.png
        ├── sounds/
        │   └── custom/
        │       └── my_sound.ogg
        ├── sounds.json
        ├── font/
        │   └── default.json
        └── lang/
            └── en_us.json
Client-mod-specific files such as OptiFine CIT and Iris shader packs use their own formats. Read conditional assets before adding them.

my-pack/
├── pack.mcmeta
├── pack.png                   ← 64×64 icon (optional)
└── assets/
    └── minecraft/             ← override vanilla (or <namespace>/ for new packs)
        ├── models/
        │   ├── block/
        │   │   └── stone.json
        │   └── item/
        │       └── diamond_sword.json
        ├── items/              ← 1.21.4+ item model definitions
        │   └── diamond_sword.json
        ├── blockstates/
        │   └── stone.json
        ├── textures/
        │   ├── block/
        │   │   └── stone.png
        │   ├── item/
        │   │   └── diamond_sword.png
        │   ├── gui/
        │   │   └── sprites/
        │   │       └── my_sprite.png
        │   └── entity/
        │       └── zombie/
        │           └── zombie.png
        ├── sounds/
        │   └── custom/
        │       └── my_sound.ogg
        ├── sounds.json
        ├── font/
        │   └── default.json
        └── lang/
            └── en_us.json
客户端 mod 专用文件(如 OptiFine CIT 和 Iris 着色器包)采用各自的格式。 添加这些文件之前,请阅读条件资源。

pack.mcmeta

pack.mcmeta

1.21.8 and earlier

1.21.8 及更早版本

json
{
  "pack": {
    "pack_format": 64,
    "description": "My Custom Resource Pack v1.0"
  }
}
json
{
  "pack": {
    "pack_format": 64,
    "description": "My Custom Resource Pack v1.0"
  }
}

1.21.9 / 1.21.10

1.21.9 / 1.21.10

json
{
  "pack": {
    "min_format": [69, 0],
    "max_format": [69, 0],
    "description": "My Custom Resource Pack v1.0"
  }
}
json
{
  "pack": {
    "min_format": [69, 0],
    "max_format": [69, 0],
    "description": "My Custom Resource Pack v1.0"
  }
}

1.21.11

1.21.11

json
{
  "pack": {
    "min_format": [75, 0],
    "max_format": [75, 0],
    "description": "My Custom Resource Pack v1.0"
  }
}
json
{
  "pack": {
    "min_format": [75, 0],
    "max_format": [75, 0],
    "description": "My Custom Resource Pack v1.0"
  }
}

26.3

26.3

json
{
  "pack": {
    "min_format": [97, 1],
    "max_format": [97, 1],
    "description": "My Custom Resource Pack v1.0"
  }
}

json
{
  "pack": {
    "min_format": [97, 1],
    "max_format": [97, 1],
    "description": "My Custom Resource Pack v1.0"
  }
}

Block Models

方块模型

assets/minecraft/models/block/my_cube.json

assets/minecraft/models/block/my_cube.json

Full cube — all six faces use the same texture:
json
{
  "parent": "minecraft:block/cube_all",
  "textures": {
    "all": "minecraft:block/stone"
  }
}
Column block (like logs):
json
{
  "parent": "minecraft:block/cube_column",
  "textures": {
    "end": "mypack:block/my_pillar_top",
    "side": "mypack:block/my_pillar_side"
  }
}
Different sides:
json
{
  "parent": "minecraft:block/cube",
  "textures": {
    "up":    "mypack:block/my_block_top",
    "down":  "mypack:block/my_block_bottom",
    "north": "mypack:block/my_block_side",
    "south": "mypack:block/my_block_side",
    "east":  "mypack:block/my_block_side",
    "west":  "mypack:block/my_block_side",
    "particle": "mypack:block/my_block_side"
  }
}
Cross model (flowers, plants):
json
{
  "parent": "minecraft:block/cross",
  "textures": {
    "cross": "mypack:block/my_flower"
  }
}
完整立方体——六个面使用同一纹理:
json
{
  "parent": "minecraft:block/cube_all",
  "textures": {
    "all": "minecraft:block/stone"
  }
}
柱状方块(例如原木):
json
{
  "parent": "minecraft:block/cube_column",
  "textures": {
    "end": "mypack:block/my_pillar_top",
    "side": "mypack:block/my_pillar_side"
  }
}
不同朝向的面:
json
{
  "parent": "minecraft:block/cube",
  "textures": {
    "up":    "mypack:block/my_block_top",
    "down":  "mypack:block/my_block_bottom",
    "north": "mypack:block/my_block_side",
    "south": "mypack:block/my_block_side",
    "east":  "mypack:block/my_block_side",
    "west":  "mypack:block/my_block_side",
    "particle": "mypack:block/my_block_side"
  }
}
交叉模型(花朵、植物):
json
{
  "parent": "minecraft:block/cross",
  "textures": {
    "cross": "mypack:block/my_flower"
  }
}

Custom geometry (elements)

自定义几何结构(elements)

json
{
  "credit": "Custom model",
  "ambientocclusion": true,
  "textures": {
    "0": "mypack:block/panel",
    "particle": "mypack:block/panel"
  },
  "elements": [
    {
      "from": [0, 0, 7],
      "to": [16, 16, 9],
      "faces": {
        "north": { "texture": "#0", "uv": [0, 0, 16, 16] },
        "south": { "texture": "#0", "uv": [0, 0, 16, 16] }
      }
    }
  ],
  "display": {
    "thirdperson_righthand": {
      "rotation": [75, 45, 0],
      "translation": [0, 2.5, 0],
      "scale": [0.375, 0.375, 0.375]
    }
  }
}
from
and
to
are in 1/16th block units (0–16).
uv
is
[x1, y1, x2, y2]
in 0–16 units.

json
{
  "credit": "Custom model",
  "ambientocclusion": true,
  "textures": {
    "0": "mypack:block/panel",
    "particle": "mypack:block/panel"
  },
  "elements": [
    {
      "from": [0, 0, 7],
      "to": [16, 16, 9],
      "faces": {
        "north": { "texture": "#0", "uv": [0, 0, 16, 16] },
        "south": { "texture": "#0", "uv": [0, 0, 16, 16] }
      }
    }
  ],
  "display": {
    "thirdperson_righthand": {
      "rotation": [75, 45, 0],
      "translation": [0, 2.5, 0],
      "scale": [0.375, 0.375, 0.375]
    }
  }
}
from
和
to
使用 1/16 个方块单位(0–16)。
uv
使用 0–16 单位,格式为
[x1, y1, x2, y2]
。

Item Models

物品模型

For 1.21.4 and later, use item definitions in
assets/<namespace>/items/
. For 1.21.3 and earlier, use the legacy model
overrides
array. Read conditional assets for the string-based current
custom_model_data
selector and the legacy numeric predicate; their values are not interchangeable.

对于 1.21.4 及更高版本,使用
assets/<namespace>/items/
中的物品定义。对于 1.21.3 及更早版本,使用旧版模型
overrides
数组。阅读条件资源,了解基于字符串的当前
custom_model_data
选择器和旧版数字谓词;两者的值不可互换。

Blockstate Definitions

方块状态定义

Simple block (no variants)

简单方块(无变体)

json
{
  "variants": {
    "": { "model": "mypack:block/my_block" }
  }
}
json
{
  "variants": {
    "": { "model": "mypack:block/my_block" }
  }
}

Facing block (4 rotations)

朝向方块(4 种旋转)

json
{
  "variants": {
    "facing=north": { "model": "mypack:block/my_block" },
    "facing=south": { "model": "mypack:block/my_block",  "y": 180 },
    "facing=east":  { "model": "mypack:block/my_block",  "y": 90  },
    "facing=west":  { "model": "mypack:block/my_block",  "y": 270 }
  }
}
json
{
  "variants": {
    "facing=north": { "model": "mypack:block/my_block" },
    "facing=south": { "model": "mypack:block/my_block",  "y": 180 },
    "facing=east":  { "model": "mypack:block/my_block",  "y": 90  },
    "facing=west":  { "model": "mypack:block/my_block",  "y": 270 }
  }
}

Random texture (weighted variants)

随机纹理(加权变体)

json
{
  "variants": {
    "": [
      { "model": "minecraft:block/grass_block",  "weight": 3 },
      { "model": "minecraft:block/grass_block_2" }
    ]
  }
}
json
{
  "variants": {
    "": [
      { "model": "minecraft:block/grass_block",  "weight": 3 },
      { "model": "minecraft:block/grass_block_2" }
    ]
  }
}

Multipart (slabs, fences, walls)

多部分模型(台阶、栅栏、墙)

json
{
  "multipart": [
    { "apply": { "model": "mypack:block/my_slab_bottom" }, "when": { "type": "bottom" } },
    { "apply": { "model": "mypack:block/my_slab_top"    }, "when": { "type": "top"    } },
    { "apply": { "model": "mypack:block/my_block"        }, "when": { "type": "double" } }
  ]
}

json
{
  "multipart": [
    { "apply": { "model": "mypack:block/my_slab_bottom" }, "when": { "type": "bottom" } },
    { "apply": { "model": "mypack:block/my_slab_top"    }, "when": { "type": "top"    } },
    { "apply": { "model": "mypack:block/my_block"        }, "when": { "type": "double" } }
  ]
}

Textures

纹理

  • Format: PNG, RGBA (32-bit)
  • Standard block/item size: 16×16 px
  • Textures can be larger (32×32, 64×64) — Minecraft scales them, but stick to powers of 2
  • Animation requires height = N × width (e.g., 16×64 for 4 frames)
  • Place block textures in
    assets/<namespace>/textures/block/
  • Place item textures in
    assets/<namespace>/textures/item/
  • All textures are referenced without the
    .png
    extension in JSON
  • 格式:PNG,RGBA(32 位)
  • 标准方块/物品尺寸:16×16 px
  • 纹理可以使用更大的尺寸(32×32、64×64)——Minecraft 会自动缩放,但应始终使用 2 的幂尺寸
  • 动画要求高度 = N × 宽度(例如 16×64 表示 4 帧)
  • 将方块纹理放在
    assets/<namespace>/textures/block/
    中
  • 将物品纹理放在
    assets/<namespace>/textures/item/
    中
  • 在 JSON 中引用所有纹理时均不包含
    .png
    扩展名

Animated texture MCMETA

动画纹理 MCMETA

assets/minecraft/textures/block/fire_0.png.mcmeta
:
json
{
  "animation": {
    "frametime": 2,
    "frames": [0, 1, 2, 3, 4, 5, 6, 7]
  }
}
If
frames
is omitted, all frames play sequentially.
frametime
is in game ticks (default 1).
assets/minecraft/textures/block/fire_0.png.mcmeta
:
json
{
  "animation": {
    "frametime": 2,
    "frames": [0, 1, 2, 3, 4, 5, 6, 7]
  }
}
如果省略
frames
,则所有帧会按顺序播放。
frametime
的单位是游戏 tick(默认值为 1)。

GUI sprites (1.20.2+)

GUI 精灵图(1.20.2+)

Place sprites at
assets/minecraft/textures/gui/sprites/<category>/<name>.png
. Reference them with
<category>/<name>
in code/JSON.
将精灵图放在
assets/minecraft/textures/gui/sprites/<category>/<name>.png
中。 在代码/JSON 中使用
<category>/<name>
引用它们。

26.1 block-model texture entries

26.1 方块模型纹理条目

For 26.1, a block-model
textures
entry may remain a sprite string or use an object. The object must have a string
sprite
;
force_translucent
, when set, must be a boolean.
json
{
  "textures": {
    "all": {
      "sprite": "mypack:block/frosted_panel",
      "force_translucent": true
    }
  }
}
Both forms identify a sprite without
.png
. Use
force_translucent
only when the geometry must render in the translucent pass despite its sprite pixels.

对于 26.1,方块模型的
textures
条目可以继续使用 sprite 字符串,也可以使用对象形式。对象必须包含字符串类型的
sprite
;设置
force_translucent
时,该值必须是布尔类型。
json
{
  "textures": {
    "all": {
      "sprite": "mypack:block/frosted_panel",
      "force_translucent": true
    }
  }
}
两种形式都可以在不包含
.png
扩展名的情况下标识 sprite。仅当几何结构必须在半透明渲染通道中呈现,即使其 sprite 像素本身并非半透明时,才使用
force_translucent
。

Sounds

声音

An event's namespace comes from the namespace containing
sounds.json
; a sound entry's
name
identifies the sound-file namespace. Sound files are Vorbis
.ogg
under
assets/<namespace>/sounds/
. Read conditional assets for a correct event example, aliases, sound-source selection, and replacement behavior.

声音事件的命名空间取自包含
sounds.json
的命名空间;声音条目中的
name
用于标识声音文件的命名空间。声音文件是位于
assets/<namespace>/sounds/
下的 Vorbis
.ogg
文件。阅读条件资源,了解正确的事件示例、别名、声音源选择和替换行为。

Language Files

语言文件

assets/minecraft/lang/en_us.json
:
json
{
  "block.mypack.my_block": "My Custom Block",
  "item.mypack.my_item": "Magic Wand",
  "entity.mypack.my_mob": "Forest Guardian",
  "death.attack.mypack.laser": "%1$s was zapped by %2$s"
}
  • Use the exact translation key format for your mod/datapack namespace
  • File name is the locale code (e.g.,
    fr_fr.json
    ,
    de_de.json
    )
  • Always provide
    en_us.json
    as the primary fallback

assets/minecraft/lang/en_us.json
:
json
{
  "block.mypack.my_block": "My Custom Block",
  "item.mypack.my_item": "Magic Wand",
  "entity.mypack.my_mob": "Forest Guardian",
  "death.attack.mypack.laser": "%1$s was zapped by %2$s"
}
  • 针对你的 mod/datapack 命名空间使用精确的翻译键格式
  • 文件名是语言区域代码(例如
    fr_fr.json
    、
    de_de.json
    )
  • 始终提供
    en_us.json
    作为主要回退文件

Fonts

字体

Read conditional assets for bitmap provider layout and private-use icon guidance.

阅读条件资源,了解位图提供商布局和私用区图标指南。

OptiFine and shaders

OptiFine 与着色器

OptiFine CIT and Iris shader packs have client-mod-specific formats. Read conditional assets before adding either; they are not portable vanilla resource-pack features.

OptiFine CIT 和 Iris 着色器包采用客户端 mod 专用格式。添加其中任一种之前,请阅读条件资源;它们不是可移植的原版资源包功能。

Installation

安装

bash
undefined
bash
undefined

Singleplayer: place in

Singleplayer: place in

~/.minecraft/resourcepacks/my-pack/
~/.minecraft/resourcepacks/my-pack/

or

or

~/.minecraft/resourcepacks/my-pack.zip
~/.minecraft/resourcepacks/my-pack.zip

Server-side (forces on clients):

Server-side (forces on clients):

Set in server.properties:

Set in server.properties:

resource-pack=https://example.com/my-pack.zip resource-pack-sha1=<sha1 hash> resource-pack-prompt={"text":"Required pack","color":"gold"}

---
resource-pack=https://example.com/my-pack.zip resource-pack-sha1=<sha1 hash> resource-pack-prompt={"text":"Required pack","color":"gold"}

---

Common Issues

常见问题

ProblemCauseFix
Model not showingWrong JSON path or syntax errorCheck
assets/<namespace>/models/
path; validate JSON
Black/pink checkerboardTexture path wrong or missingCheck
textures/
path, file extension not in JSON
Blockstate not applyingWrong state property nameUse F3 to inspect block state; use
/data get block <x> <y> <z>
for block-entity NBT
Animation not workingWrong MCMETA locationMust be same folder as texture, named
texture.png.mcmeta
Custom sound not playingNot in
sounds.json
Register sound event in
sounds.json
, match namespace
Pack not loadingWrong
pack_format
or
min_format
/
max_format
values
Update
pack.mcmeta
for the exact 1.21.x patch
问题原因修复方法
模型未显示JSON 路径错误或存在语法错误检查
assets/<namespace>/models/
路径;验证 JSON
显示黑紫色棋盘格纹理路径错误或文件缺失检查
textures/
路径,并确认 JSON 中不包含文件扩展名
方块状态未应用状态属性名称错误使用 F3 检查方块状态;使用
/data get block <x> <y> <z>
检查方块实体 NBT
动画未生效MCMETA 位置错误必须与纹理位于同一文件夹,并命名为
texture.png.mcmeta
自定义声音未播放未在
sounds.json
中注册
在
sounds.json
中注册声音事件,并匹配命名空间
资源包未加载
pack_format
或
min_format
/
max_format
值错误
根据确切的 1.21.x 补丁版本更新
pack.mcmeta

Validator Script

验证脚本

Use the bundled validator script before shipping a resource-pack update:
Unbundled references to another namespace's models, textures, sounds, or fonts are warnings requiring runtime verification with the dependency present. Missing files in the current namespace fail; strict mode also fails unresolved warnings.
bash
undefined
在发布资源包更新之前,使用随附的验证脚本:
对其他命名空间的模型、纹理、声音或字体的外部引用会触发警告;需要在相关依赖存在时进行运行时验证。当前命名空间内缺少文件会校验失败;严格模式还会将尚未解决的警告视为失败。
bash
undefined

Run from the installed skill directory (for example
.claude/skills/minecraft-resource-pack
):

Run from the installed skill directory (for example
.claude/skills/minecraft-resource-pack
):

./scripts/validate-resource-pack.sh --root /path/to/resource-pack
./scripts/validate-resource-pack.sh --root /path/to/resource-pack

Strict mode treats warnings as failures:

Strict mode treats warnings as failures:

./scripts/validate-resource-pack.sh --root /path/to/resource-pack --strict

What it checks:
- JSON validity for `pack.mcmeta` and `assets/**/*.json`
- Legacy versus modern `pack.mcmeta` field shape, including integer, `[major]`, and `[major, minor]` versions
- Model/blockstate/font/sounds references resolve to real files
- Current `custom_model_data` select cases use strings; 26.1 texture objects use a string `sprite` and optional boolean `force_translucent`
- Same-namespace `type: "event"` sound aliases name an event in that `sounds.json`
- Every `*.png.mcmeta` has a matching `*.png`

The validator cannot resolve a sound event owned by another namespace, or prove
that a command or mod code invokes an event with the intended sound source.
Those cases warn and require an exact-client runtime check.

---
./scripts/validate-resource-pack.sh --root /path/to/resource-pack --strict

它会检查:
- `pack.mcmeta` 和 `assets/**/*.json` 的 JSON 有效性
- 旧版与现代 `pack.mcmeta` 字段结构,包括整数、`[major]` 和 `[major, minor]` 版本格式
- 模型、方块状态、字体和声音引用是否指向真实文件
- 当前 `custom_model_data` 选择用例是否使用字符串;26.1 纹理对象是否使用字符串类型的 `sprite` 和可选的布尔类型 `force_translucent`
- 同一命名空间内 `type: "event"` 的声音别名是否引用该 `sounds.json` 中的事件
- 每个 `*.png.mcmeta` 是否有对应的 `*.png` 文件

验证器无法解析由其他命名空间拥有的声音事件,也无法证明命令或 mod 代码是否以预期的声音源调用事件。这些情况会产生警告,并要求在客户端进行精确的运行时检查。

---

References

参考资料