禁用粒子效果
beginner
如果您想要禁用某个粒子效果,建议直接在粒子文件中进行设置,而不是简单地在 particles.png 中将粒子贴图设为透明。此外,与透明化处理相比,禁用粒子效果可能会带来轻微的性能提升,因为透明粒子仍然会被发射(只是不可见)。
禁用粒子发射的基本原理如下:
RP/particles/some_vanilla_particle.json
json
{
"format_version": "1.10.0",
"particle_effect": {
"description": {
"identifier": "minecraft:some_vanilla_particle",
"basic_render_parameters": {
"material": "particles_alpha",
"texture": "textures/particle/particles"
}
},
"components": {
"minecraft:emitter_lifetime_expression": {
"activation_expression": 0,
"expiration_expression": 1
},
"minecraft:emitter_rate_manual": {
"max_particles": 0
}
}
}
}(注:JSON代码部分保持原样未翻译,因为这是需要直接使用的代码内容)


