MinecraftBE如何制作超漂亮的颗粒包(代码示例+完整下载)

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,看看自己能做出什么效果吧!

本文为原创,BILIBILI@末影小末EnderMo,未经允许请勿转载。

下载

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值