1. Wiki
  2. /Entities
  3. /minecraft:genetics

minecraft:genetics

Don't want to write this by hand? GodCraft sets minecraft:genetics for you with a switch.Get GodCraft

Overview

minecraft:genetics is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Gives the entity genes that babies inherit from both parents, like panda personalities or goat horns. Matching gene values fire events on the baby to show the trait.

Fields

FieldTypeDefaultDescription
genesListnoneList of genes, their possible values and the events tied to them.
mutation_rateDecimal"0.03125"Chance that a baby gets a random gene value instead of one from a parent.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

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

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