Minecraft 如何制作修改和制作方块模型

请注意时效性!文章创建于:2022-08-28

本教程使用的blockstates和models文件为1.8.9的资源,

可能不适用于新版本!

请拥有一定JSON基础和材质包制作基础再进行阅读!

Blockstates和Models文件夹

解压1.8.9.jar,你可以发现里面有asstes这个文件夹,这个是各种资源存储的地方,包括Models和Blockstates。
Models是指模型,Blockstates是指方块状态,而Models是在Blockstates之中被调用的,

Blockstates

这是已激活的中继器的Blockstates,其中记录了他全部的状态,如在1tick延迟,2tick延迟下的状态。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"variants": {
"delay=1,facing=south,locked=false": { "model": "repeater_on_1tick" },
"delay=1,facing=west,locked=false": { "model": "repeater_on_1tick", "y": 90 },
"delay=1,facing=north,locked=false": { "model": "repeater_on_1tick", "y": 180 },
"delay=1,facing=east,locked=false": { "model": "repeater_on_1tick", "y": 270 },
"delay=2,facing=south,locked=false": { "model": "repeater_on_2tick" },
"delay=2,facing=west,locked=false": { "model": "repeater_on_2tick", "y": 90 },
"delay=2,facing=north,locked=false": { "model": "repeater_on_2tick", "y": 180 },
"delay=2,facing=east,locked=false": { "model": "repeater_on_2tick", "y": 270 },
"delay=3,facing=south,locked=false": { "model": "repeater_on_3tick" },
"delay=3,facing=west,locked=false": { "model": "repeater_on_3tick", "y": 90 },
"delay=3,facing=north,locked=false": { "model": "repeater_on_3tick", "y": 180 },
"delay=3,facing=east,locked=false": { "model": "repeater_on_3tick", "y": 270 },
"delay=4,facing=south,locked=false": { "model": "repeater_on_4tick" },
"delay=4,facing=west,locked=false": { "model": "repeater_on_4tick", "y": 90 },
"delay=4,facing=north,locked=false": { "model": "repeater_on_4tick", "y": 180 },
"delay=4,facing=east,locked=false": { "model": "repeater_on_4tick", "y": 270 },
"delay=1,facing=south,locked=true": { "model": "repeater_on_locked_1tick" },
"delay=1,facing=west,locked=true": { "model": "repeater_on_locked_1tick", "y": 90 },
"delay=1,facing=north,locked=true": { "model": "repeater_on_locked_1tick", "y": 180 },
"delay=1,facing=east,locked=true": { "model": "repeater_on_locked_1tick", "y": 270 },
"delay=2,facing=south,locked=true": { "model": "repeater_on_locked_2tick" },
"delay=2,facing=west,locked=true": { "model": "repeater_on_locked_2tick", "y": 90 },
"delay=2,facing=north,locked=true": { "model": "repeater_on_locked_2tick", "y": 180 },
"delay=2,facing=east,locked=true": { "model": "repeater_on_locked_2tick", "y": 270 },
"delay=3,facing=south,locked=true": { "model": "repeater_on_locked_3tick" },
"delay=3,facing=west,locked=true": { "model": "repeater_on_locked_3tick", "y": 90 },
"delay=3,facing=north,locked=true": { "model": "repeater_on_locked_3tick", "y": 180 },
"delay=3,facing=east,locked=true": { "model": "repeater_on_locked_3tick", "y": 270 },
"delay=4,facing=south,locked=true": { "model": "repeater_on_locked_4tick" },
"delay=4,facing=west,locked=true": { "model": "repeater_on_locked_4tick", "y": 90 },
"delay=4,facing=north,locked=true": { "model": "repeater_on_locked_4tick", "y": 180 },
"delay=4,facing=east,locked=true": { "model": "repeater_on_locked_4tick", "y": 270 }
}
}

就拿第一行的来说,delay表示延迟,facing表示方向,locked表示是否被锁存。

而最重要的就是后面的model,这个属性指定了中继器在此情况下要加载哪个模型。

另外,这个model是可以在Models文件夹被找到的。

接下来就以repeater_on_1tick这个模型讲一下。

1
"delay=1,facing=south,locked=false": { "model": "repeater_on_1tick" }

Models

这个就是它的模型文件了,

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
"ambientocclusion": false,
"textures": {
"particle": "blocks/repeater_on",
"slab": "blocks/stone_slab_top",
"top": "blocks/repeater_on",
"lit": "blocks/redstone_torch_on"
},
"elements": [
{
"from": [ 0, 0, 0 ],
"to": [ 16, 2, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
"north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" },
"south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" },
"west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" },
"east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" }
}
},
{ "from": [ 7, 7, 6 ],
"to": [ 9, 7, 8 ],
"faces": {
"up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" }
}
},
{ "from": [ 7, 2, 5 ],
"to": [ 9, 8, 9 ],
"faces": {
"west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" },
"east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }
}
},
{ "from": [ 6, 2, 6 ],
"to": [ 10, 8, 8 ],
"faces": {
"north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" },
"south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }
}
},
{ "from": [ 7, 7, 2 ],
"to": [ 9, 7, 4 ],
"faces": {
"up": { "uv": [ 7, 6, 9, 8 ], "texture": "#lit" }
}
},
{ "from": [ 7, 2, 1 ],
"to": [ 9, 8, 5 ],
"faces": {
"west": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" },
"east": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }
}
},
{ "from": [ 6, 2, 2 ],
"to": [ 10, 8, 4 ],
"faces": {
"north": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" },
"south": { "uv": [ 6, 5, 10, 11 ], "texture": "#lit" }
}
}
]
}

Ambientocclusion

ambientocclusion具体有什么用不知道,但是翻译过来是环境光遮蔽。

Textures

1
2
3
4
5
6
"textures": {
"particle": "blocks/repeater_on",
"slab": "blocks/stone_slab_top",
"top": "blocks/repeater_on",
"lit": "blocks/redstone_torch_on"
}

textures对象之下表示在此模型文件中要调用的一切贴图文件。
particle举例。

1
"particle": "blocks/repeater_on"

"blocks/repeater_on"其实是贴图文件的位置,你可以在textures文件夹找到对应的文件。

"particle"表示该贴图的名字、代号,并且名字只在本模型文件内生效。

elements中需要调用的就是"particle",也就是贴图的名字、代号。

Elements

elements是一个集合类对象,表示模型的各种部件的集合,或者就叫各种部件,并且指定了部件的大小,使用的材质。

1
2
3
4
5
6
7
8
9
10
11
12
13
"elements": [
{
"from": [ 0, 0, 0 ],
"to": [ 16, 2, 16 ],
"faces": {
"down": { "uv": [ 0, 0, 16, 16 ], "texture": "#slab", "cullface": "down" },
"up": { "uv": [ 0, 0, 16, 16 ], "texture": "#top" },
"north": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "north" },
"south": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "south" },
"west": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "west" },
"east": { "uv": [ 0, 14, 16, 16 ], "texture": "#slab", "cullface": "east" }
}
}

from to表示这个部件的长宽高。

因为部件实际上就是一个指定了长宽高的长方体,所以只需要用到2个顶点就可以表示它的大小了。

1
2
"from": [ x1, y1, z1 ],
"to": [ x2, y2, z2 ],

faces表示这个部件六个面使用的材质、贴图,如up面,north面…

up面举例子,uv,表示使用该贴图的哪个地方,它实际上是一个长方形的两个顶点的集合,也就是说:

1
"uv": [ x1, y1, x2, y2 ]

注意下,这个y并不是高度,是宽度。
如果你的uv超过或者低于这个面的大小,那么就会分别出现压缩和拉伸的问题。


Minecraft 如何制作修改和制作方块模型
http://htext.top/post/88ad986b.html
作者
Huanlan233
发布于
2022年8月28日
许可协议