MCBE如何制作自己的颗粒包
本文基于Minecraft基岩版进行创作.
首先我们来看一下MC颗粒的储存格式。这是一个示例代码。
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "test1",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particle/particles"
}
},
"curves": {
"variable.color_curve": {
"type": "bezier",
"nodes": [ 0.0, 0.1, 1.0, 0.8 ],
"input": "variable.particle_age",
"horizontal_range": "variable.particle_lifetime"
}
},
"components": {
"minecraft:emitter_rate_instant": {
"num_particles": 100
},
"minecraft:emitter_lifetime_once": {
"active_time": 0
},
"minecraft:emitter_shape_sphere": {
"radius": 0.1,
"direction": "outwards"
},
"minecraft:particle_initial_speed": "Math.random(0.0, 15.0)",
"minecraft:particle_initial_spin": {
"rotation": "Math.random(0, 360)"
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": "math.random(1.0, 3.0)"
},
"minecraft:particle_motion_dynamic": {
"linear_acceleration": [ 0, 2.0, 0 ],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": {
"size": [ "0.1", "0.1" ],
"facing_camera_mode": "lookat_xyz",
"uv": {
"texture_width": 16,
"texture_height": 16,
"uv": [ 2, 2 ],
"uv_size": [ 1, 1 ]
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"gradient": [
[ 1, 0, 0, 1 ],
[ 0, 1, 1, 1 ]
],
"interpolant": "variable.color_curve"
}
},
"minecraft:particle_appearance_lighting": {}
}
}
}
, , ,
那么,来看一下解析
"format_version": "1.10.0", //版本
"particle_effect": { //颗粒效果大分支
"description": { //介绍
"identifier": "test1", //颗粒id
"basic_render_parameters": {
"material": "particles_alpha", //材料,就是颜色通道
"texture": "textures/particle/particles" //材质,就是颗粒的图片
}
},
"curves": { //开始绘制
"variable.color_curve": {
"type": "bezier",
"nodes": [ 0.0, 0.1, 1.0, 0.8 ], //node
"input": "variable.particle_age", //导入生存时间
"horizontal_range": "variable.particle_lifetime" //让生存时间变成变量
}
},
"components": {
"minecraft:emitter_rate_instant": { //数值
"num_particles": 100
},
"minecraft:emitter_lifetime_once": {
"active_time": 0
},
"minecraft:emitter_shape_sphere": {
"radius": 0.1,
"direction": "outwards"
},
"minecraft:particle_initial_speed": "Math.random(0.0, 15.0)", //采取随机值
"minecraft:particle_initial_spin": {
"rotation": "Math.random(0, 360)"
},
"minecraft:particle_lifetime_expression": {
"max_lifetime": "math.random(1.0, 3.0)"
},
"minecraft:particle_motion_dynamic": { //动态效果(跟踪)
"linear_acceleration": [ 0, 2.0, 0 ],
"linear_drag_coefficient": 5
},
"minecraft:particle_appearance_billboard": { //颜色板
"size": [ "0.1", "0.1" ],
"facing_camera_mode": "lookat_xyz", //面向玩家摄像机xyz
"uv": {
"texture_width": 16, //读取一个材质的大小 w
"texture_height": 16,//h
"uv": [ 2, 2 ], //UV编辑
"uv_size": [ 1, 1 ]
}
},
"minecraft:particle_appearance_tinting": {
"color": {
"gradient": [
[ 1, 0, 0, 1 ], //颜色变化
[ 0, 1, 1, 1 ]
],
"interpolant": "variable.color_curve"
}
},
"minecraft:particle_appearance_lighting": {}
}
}
}
接下来,把这个创建一个新文件夹,再创建一个particles文件夹,把这个丢进去。
退回到主文件夹,创建一个manifest.json,代码如下
{
"format_version": 1,
"header": {
"description": "2.3+New UUID/Particle",
"name": "XM_Particle_PreviewEdition",
"uuid": "39e02c6e-ec05-4a76-94a3-f77a1541b5a7",
"version": [0, 0, 1],
"min_engine_version": [1, 12, 0]
},
"modules": [
{
"description": "resourcePack.vanilla.description",
"type": "resources",
"uuid": "53644fac-a276-42e5-843f-a3c6f169a9ab",
"version": [0, 0, 1]
}
]
}
好,那么运行效果是什么呢?
我们打开消息框得到命令方块。/give @a command_block
在命令方块输入指令
/particle test1 ~ ~ ~
按下SHIFT(潜行),放上红石(按钮,拉杆)
得到下列效果,试着改一下color_gradient和UV,看看自己能做出什么效果吧!