1. Wiki
  2. /实体
  3. /minecraft:genetics

minecraft:genetics

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:genetics。Get GodCraft

概览

minecraft:genetics 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 给实体添加基因,幼崽会从父母双方继承,比如熊猫的性格或山羊的角。基因值匹配时会在幼崽身上触发事件来表现该特征。

字段

字段类型默认值说明
genesList无基因列表,包括可能的取值和对应的事件。
mutation_rateDecimal"0.03125"幼崽获得随机基因值而不是继承父母的概率。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

BP/entities/<name>.json
{
  "minecraft:genetics": {
    "genes": {},
    "mutation_rate": "0.03125"
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more