Skip to content

生物组件速查 ​

本页汇总中国版自定义实体所有可用的 JSON 组件,按功能分类,标注可选参数,方便快速查阅。

使用方法

  • 实体行为定义写在行为包 entities/ 目录下
  • 基础格式使用 format_version: "1.10.0"
  • 组件写在 components 对象中;可变部分写在 component_groups 中,通过事件切换
  • 中国版额外支持 netease: 前缀组件和 Python Mod SDK 扩展

基础属性 ​

组件类型可选参数说明详细文档
minecraft:type_familyobjectfamily: array(str),如 ["monster", "mob"]类型族,用于 AI 目标筛选自定义基础生物
minecraft:healthobjectvalue: int, max: int生命值自定义基础生物
minecraft:scaleobjectvalue: float(默认 1.0)缩放比例自定义基础生物
minecraft:collision_boxobjectwidth: float(0~10), height: float(0~10)碰撞盒自定义基础生物
minecraft:physicsobjecthas_gravity: bool, has_collision: bool物理效果,通常为空对象自定义基础生物
minecraft:experience_rewardobjecton_death: str(MoLang表达式)经验值奖励自定义基础生物
minecraft:lootobjecttable: str(掉落表路径)掉落表路径自定义基础生物
minecraft:is_hidden_when_invisiblebooltrue / false隐身时是否隐藏自定义基础生物
minecraft:pushableobjectis_pushable: bool, is_pushable_by_piston: bool是否可推动自定义基础生物

AI 行为 ​

组件类型可选参数说明详细文档
minecraft:behavior.temptobjectpriority: int, items: array(str), speed_multiplier: float, can_tempt_while_ridden: bool被食物吸引自定义基础生物
minecraft:behavior.panicobjectpriority: int, speed_multiplier: float受伤后逃跑
minecraft:behavior.random_strollobjectpriority: int, speed_multiplier: float随机漫步
minecraft:behavior.look_at_playerobjectpriority: int, look_distance: float, probability: float看向玩家
minecraft:behavior.random_look_aroundobjectpriority: int, look_time: array([min, max])随机张望
minecraft:behavior.floatobjectpriority: int水面漂浮
minecraft:behavior.leap_at_targetobjectpriority: int, yd: float, ydl: float向目标跳跃
minecraft:behavior.knockback_roarobjectpriority: int, duration: int, knockback_damage: int, knockback_range: float, knockback_horizontal_strength: float, knockback_vertical_strength: float击退咆哮
minecraft:behavior.squid_diveobjectpriority: int鱿鱼下潜
minecraft:behavior.squid_fleeobjectpriority: int鱿鱼逃跑
minecraft:behavior.squid_idleobjectpriority: int鱿鱼待机

骑乘 ​

组件类型可选参数说明详细文档
minecraft:rideableobjectseat_count: int, family_types: array(str), seats: array({position:[x,y,z], min_rider_count, max_rider_count}), interact_text: str可被骑乘进阶生物开发
minecraft:behavior.mount_pathingobjectpriority: int, speed_multiplier: float, target_dist: float, track_target: bool骑乘寻路进阶生物开发

传感器 ​

组件类型可选参数说明
minecraft:environment_sensorobjecttriggers: array({filters, event})环境传感器
minecraft:damage_sensorobjecttriggers: array({on_damage:{filters}, cause, deals_damage: bool, damage_modifier: int, damage_multiplier`: float})伤害传感器

爆炸 ​

组件类型可选参数说明
minecraft:explodeobjectfuse_length: float, power: int, causes_fire: bool, break_blocks: bool, fuse_lit: bool爆炸属性

交互 ​

组件类型可选参数说明
minecraft:interactobjectinteractions: array({use_item: str, hurt_item: int, spawn_entities: array, play_sounds: array, interact_text: str, on_interact`: {filters, event}})交互行为

中国版专属组件(netease:) ​

组件类型可选参数说明
netease:entity_tickobject需通过 AddEntityTickEventWhiteList 注册白名单自定义实体 tick 事件

组件速写模板 ​

基础敌对生物 ​

json
{
  "format_version": "1.10.0",
  "minecraft:entity": {
    "description": {
      "identifier": "mymod:ghost",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "components": {
      "minecraft:type_family": { "family": ["ghost", "monster", "mob"] },
      "minecraft:health": { "value": 20, "max": 20 },
      "minecraft:collision_box": { "width": 0.8, "height": 1.8 },
      "minecraft:movement": { "value": 0.25 },
      "minecraft:movement.basic": {},
      "minecraft:navigation.walk": { "can_walk": true, "avoid_water": true },
      "minecraft:follow_range": { "value": 16, "max": 32 },
      "minecraft:attack": { "damage": 4 },
      "minecraft:behavior.melee_attack": { "priority": 2, "speed_multiplier": 1.2, "track_target": true },
      "minecraft:behavior.nearest_attackable_target": { "priority": 1, "within_radius": 16 },
      "minecraft:physics": {}
    }
  }
}

可骑乘生物 ​

json
{
  "minecraft:rideable": {
    "seat_count": 1,
    "family_types": ["player"],
    "seats": [
      {
        "position": [0.0, 0.6, 0.0]
      }
    ]
  },
  "minecraft:behavior.mount_pathing": {
    "priority": 2,
    "speed_multiplier": 1.0,
    "target_dist": 4.0
  }
}