Skip to content
On this page

猹引擎

实体模型配置

实体模型配置用于定义生物实体的模型规则。

文件位置

txt
plugins/ChaEngine/entity/*.yml

生物实体模型完整示例

yml
测试生物:
  # 可选:手动指定模型ID
  id: "test_mob"
  # 模型路径,根目录:resourcepacks/ChaEngine/model/
  model: "测试生物/测试生物.geo.json"
  # 动画文件路径
  animation: "测试生物/测试生物.animation.json"
  # 贴图文件路径
  texture: "测试生物/测试生物.png"
  # 缩放比例
  scale: 1.0
  # 位置偏移 [x, y, z]
  position: [ 0, 0, 0 ]
  # 碰撞体积 [x, y, z]
  collision: [ 1, 1, 1 ]
  # 匹配规则
  # 多行为“命中任意一条即生效”
  # 单行多个条件用英文逗号隔开,表示该行条件都要命中
  match:
    - "name#start#测试,nbt#custom#测试生物"
    - "name#equal#测试生物"

规则说明

  • entity/*.yml 通过 match 自动匹配实体外观。
  • 修改完成后执行引擎重载动作让配置生效。

多生物规则示例

yml
精英守卫:
  model: "npc/guard.geo.json"
  animation: "npc/guard.animation.json"
  texture: "npc/guard.png"
  scale: 1.0
  position: [ 0, 0, 0 ]
  collision: [ 1, 1, 1 ]
  match:
    - "name#contains#守卫"
    - "type#equal#minecraft:wither_skeleton"

活动首领:
  model: "boss/event_boss.geo.json"
  animation: "boss/event_boss.animation.json"
  texture: "boss/event_boss.png"
  scale: 1.2
  position: [ 0, 0, 0 ]
  collision: [ 1.2, 2.6, 1.2 ]
  match:
    - "name#equal#活动首领"