Membrane Protein

Animal genetics system: hidden genotypes, Mendelian inheritance, and quantitative traits for livestock breeding.

Membrane Protein

Minecraft 1.20.1 · Forge 47.x · Java 17

Vanilla animals have traits, but they have no genes. A sheep's wool colour is a coin flip between its parents. A horse's health, speed and jump are re-rolled from scratch every generation. Cows, pigs and chickens inherit nothing at all.

There is no genotype layer — which means no hidden recessive alleles, and no way to breed a line that actually gets better over time.

Membrane Protein adds that layer. Every animal now carries a real genome: two copies per gene locus, passed down Mendelian-style, mutating at a per-locus rate, with the phenotype computed from the genotype. Recessive genes can hide. Quantitative traits accumulate across generations. Selective breeding finally pays off.


What you get

  • Real genomes on every animal — two alleles per locus, stored on the entity and saved with the world
  • Hidden recessive genes — a carrier looks normal and passes the gene on anyway
  • Quantitative traits that accumulate — weight, growth, health, speed, and more drift up or down by 1–5% per mutation instead of being re-rolled
  • Litter sizes from 1 to 6, decided by the mother's genes
  • Sex-linked inheritance, chromosome linkage and genetic map distance (in centimorgans), with crossovers
  • 16 wool colours driven by 6 pigment genes — including incomplete dominance and co-dominance
  • Vanilla horses fully re-implemented — coat, markings, health, speed and jump are now inherited, not randomised
  • Everything is data-driven — balance lives in datapack JSON, so you can retune or add species without touching code
  • No mixins — it uses Forge events, public APIs, and a single access transformer

The breeding loop

  1. Craft a Genetic Sequencer (glass panes, iron ingot, redstone).
  2. Right-click any cow, pig, sheep, chicken or horse to read its genotype and phenotype.
  3. Feed two adults of opposite sex and let them breed.
  4. Each offspring takes one copy of every locus from each parent — with mutation and, on the same chromosome, crossover.
  5. Keep the best offspring. Repeat.

Because genes are stored as data rather than as a coat colour, a 10th-generation animal is measurably better than a wild one. That is the whole point of the mod.


Livestock

Shared across cows, pigs, chickens and sheep

  • Sex — opposite sexes are required to breed (configurable)
  • Weight — controls render size and scales meat drops on death
  • Growth — how fast a baby grows up
  • Health — max health multiplier
  • Speed — movement speed multiplier
  • Litter size — how many babies the mother has, rounded down and clamped to 1–6 (default 2)

Cow

  • Mushroom mutation (recessive) — adults slowly turn into Mooshrooms, roughly one minute. Shear it to turn it back into a normal cow; it can grow again.
  • Tight hide (recessive, ~4% of the wild population) — its leather drops are replaced by Fine Leather, a new item.

Pig

  • Weight cap raised to 250% (300 kg)
  • Meat yield is unusually weight-sensitive: a 300 kg pig drops around 20 porkchops instead of the usual 1–3

Sheep

  • Bare (ww, ~4%) — permanently sheared, cannot eat grass, drops no wool
  • Special wool (ww + ss, ~0.36%) — suppresses bareness: the sheep keeps wool, can eat again, and drops iron nuggets when sheared
  • Special wool + yellow wool — the nuggets become gold nuggets, and the speckles on its wool turn gold
  • Graze rate — how often it tries to eat grass
  • Wool amount — scales both the wool dropped and the iron/gold nugget count
  • 6 pigment genes producing all 16 vanilla wool colours, with melanin, yellow pigment, a three-step dilution gene, a metabolic modifier, co-dominant magenta/green, and a recessive pink
  • Yellow pigment sits on the sex chromosome, so it is sex-linked

Horse

Vanilla horses already "inherit" a little: coat is a 4/9–4/9–1/9 roll between parents and a random re-roll, markings 2/5–2/5–1/5, and stats are parent average ± a random spread. None of that can be selected for.

This mod replaces all of it:

  • 7 coat variants (white, creamy, chestnut, brown, black, gray, dark brown) as seven alleles with a dominance hierarchy
  • 5 marking types as a second multi-allelic locus — "no markings" has to be homozygous
  • Health, speed and jump strength are now inherited quantitative traits, with their base values pinned to the vanilla midpoints so the genes alone decide the result
  • Plus weight, growth and litter size

Items

Genetic Sequencer — right-click an animal to print its full genotype and phenotype. Can be set to show phenotype only, if you prefer hidden genes.

  .   glass pane   .
glass pane  iron  glass pane
  .   redstone     .

Fine Leather — not craftable. It drops from cows carrying the recessive tight hide trait.


Commands

Root command /mpgenes, permission level 2.

  • /mpgenes show <target> — print loci, alleles, phenotype and rule results
  • /mpgenes set <target> <locus> <0|1> <value> — overwrite one copy (allele index for discrete traits, percentage for quantitative ones)
  • /mpgenes breed <parentA> <parentB> — debug breeding, one offspring
  • /mpgenes list — list loaded species tables

Example — turn a sheep into the bare mutation:

/mpgenes set @e[type=sheep,limit=1] 5 0 1
/mpgenes set @e[type=sheep,limit=1] 5 1 1

Configuration

config/membrane_protein-genetics-common.toml

  • enabled — master switch
  • applyHealthAttribute / healthScale — whether and how strongly the health gene applies
  • applySpeedAttribute / speedScale — same for movement speed
  • applyJumpAttribute / jumpScale — same for jump strength
  • scannerRevealsGenotype — hide the raw genotype from the sequencer
  • growthAffectsAging — whether the growth gene affects baby animals
  • weightDropBonus — meat drop sensitivity to weight (per-species override available in JSON)
  • requireOppositeSex — set to false to allow any two adults to breed
  • mushroomConversionTicks — Mooshroom conversion time
  • sizeScaleStrength / minEntityScale / maxEntityScale — how weight maps to render size

Datapack support

Species live in data/membrane_protein/species/*.json and can be overridden by a datapack; /reload applies changes immediately.

A quantitative locus looks like this:

{
  "id": "weight", "group": "chr_weight", "quantitative": "weight",
  "mutation_rate": 0.02, "mutation_step": [1, 5],
  "wild_mean": 100.0, "wild_sd": 5.0, "range": [60.0, 150.0]
}

Discrete loci use an alleles array where each allele carries dominance, effects and optional suppresses. Multi-gene interactions (like wool colour) are expressed as an ordered trait_rules table — first match wins, so rule order doubles as a dominance hierarchy.

Chromosomes and genetic map distance are also JSON: group acts as the chromosome, and map_distance (signed, relative to the centromere, in centimorgans) determines recombination between loci via the Haldane mapping function.


Installing into an existing world

  • Wild animals get a genome the next time they are loaded; nothing else is needed.
  • Horses already in your world will change. Their health, speed and jump are re-derived from a generated genome, because vanilla's per-horse randomisation is replaced.
  • No world-breaking changes: removing the mod leaves ordinary vanilla animals behind.

Known limitations

Being upfront about these:

  • Size scaling is visual only. Minecraft 1.20.1 has no scale attribute, and changing the hitbox would require a mixin, which this mod avoids. A large animal still has a vanilla-sized hitbox.
  • The wool speckle layer for special-wool sheep is implemented but not yet verified in-game by the developer — logic, textures and networking are all in place, but rendering could not be tested in a headless environment. Feedback is very welcome.
  • Shearing is taken over. Sheep shearing with special-wool / wool-amount genes bypasses Forge's IForgeShearable, so other mods' shear hooks will not fire.
  • One sex locus only — no ZW or haplodiploid systems (sex-linked inheritance is supported though).
  • No gene-editing item — gene manipulation is command-only.
  • Mule edge case — horse × donkey offspring receive a horse genome and therefore genetic stats, but their appearance is unchanged.
  • Only cow, mooshroom, pig, sheep, chicken and horse are bound. Other animals (donkeys, llamas, rabbits, …) are untouched.

Installation

  1. Install Minecraft Forge 47.x for 1.20.1.
  2. Drop the jar into your mods folder.
  3. That's it — no other dependencies, works on both client and server.

Modpacks and permissions

Free to include in any modpack. Credit is appreciated but not required.


Technical notes

For anyone who cares how it works:

  • The genetic core (genetics/core) has no Minecraft dependency and comes with 37 self-test assertions covering Mendelian ratios, complete linkage, free recombination, sex-linked inheritance, and the additivity of map distances.
  • Inheritance is a two-step process: the per-chromosome haploid gamete (with crossovers between loci) is drawn first, then mutations are applied per locus.
  • Phenotypes are base × mean(allele percentages) for quantitative traits, plus discrete allele contributions with a dominance factor that covers complete dominance, recessiveness, incomplete dominance and co-dominance with one formula.
  • Discrete, multi-gene phenotypes use an ordered rule table evaluated against the phenotype map.
  • Vanilla horses are handled by pinning attribute base values to vanilla midpoints, then applying gene multipliers — this is what makes their stats heritable at all.
  • Code comments and design docs are in Chinese; the code itself is in English.

Feedback

This is an early version (0.1.0). If something behaves oddly — especially breeding results, or the special-wool rendering — please report it with the seed if you have one.

Membrane Protein Team

profile avatar
Owner
Forgeborn tier icon
  • 7
    Followers
  • 8
    Projects
  • 163.2K
    Downloads

More from moguangView all