Magical gene / no coat effect

Weather sensitive (jump)

The same idea as the speed locus and a completely separate gene: a positive and a negative allele per weather type, moving how high the horse jumps while that weather holds. Unlinked — inheriting one tells you nothing about the other.

Built, and not yet seen in game

The gene, its inheritance and its founder table exist and are covered by the test suite; the translator that turns it into behaviour was written against the 26.1.2 sources and is flagged unverified in its own comments. Nothing on this page has been watched happening to a horse. What to look at, and what is most likely to be wrong, is on To be verified.

What it does

A positive allele and a negative one for each kind of weather. One copy moves jump strength by the percentage written on that copy while its weather holds; two copies add both percentages. One of each very nearly cancels.

CombinationOutcome
two positive copiesboth percentages, added — a real difference
one positive copythat copy’s percentage
one of eachnear enough nothing
one negative copythat copy’s percentage, off
two negative copiesboth, off — noticeable and annoying

What it is like to own

Nothing at all, most of the time. Then it rains, and the horse you have ridden for a week is a different animal. It is the only locus in the mod whose expression you cannot check on demand — you wait for weather.

Health

None directly. A badly weather-sensitive horse is slower or shorter in the jump when it rains, which is a hazard only if you were relying on it.

Gene key
horsegenetics.weather_jump
Alleles
a positive and a negative per weather type, plus n
Inheritance
incomplete dominance — copies add
Reaches the game as
an attribute effect on jump_strength, gated on raining / thundering
Epigenetic
the magnitude, per allele copy
Coat effect
none, ever
Correction: this is not a copy of swim speed

An earlier draft of this page said the gene was “nearly a copy” of swim speed on AbstractMagicFactorGene. That base class is strictly three alleles — one that pushes the quantity up, one that pushes it down, and the wild type — so it cannot express a positive and a negative allele per weather type. What it genuinely provides is the inheritance: codominance, a percentage drawn per allele copy, and both copies adding with the down allele counting negative.

So what it actually needs

Two options, and they are a real choice rather than a detail:

  • One locus per weather type — rain speed, storm speed, and so on — each one a genuine AbstractMagicFactorGene subclass costing almost nothing. Cheapest by far, and it multiplies the locus count by the number of weathers, twice over once the jump twin is counted.
  • One locus, several signed pairs — alleles Rain+, Rain−, Thndr+, Thndr− and the wild type, each carrying its own epigenetic delta and its own condition. This needs a generalisation of the factor gene to several conditioned pairs, which is new code — but it keeps the locus count at two and gives a genuinely interesting compound heterozygote: a Rain+/Thndr− horse is better in rain and worse in storms, and both halves apply independently because their conditions never both hold.

The second is what this page describes and what the design settled on. It is not free, and the estimate should say so.

Snow is not weather in Minecraft

There is no snowfall state to test — snow is rain in a cold biome. A snowing flag is therefore a biome lookup, not a weather one, and belongs on an interval sample rather than in a per-tick condition check.

Removal is already handled

The attribute path reconciles every tick and clearAttributes takes off any modifier the horse is no longer asking for — which is the half that would otherwise leave a rain bonus stuck on a horse standing in sunshine. Nothing new to write.

Built as a copy, on purpose

This gene and weather sensitive (speed) are the same class with a different attribute and a different key. Resisting the urge to make one parameterised locus with two outputs is deliberate: one locus would inherit as one unit, and the whole point is that they do not.

Two loci rather than one gene with two effects

A single weather locus moving both stats would make “good in the rain” a single thing to breed for, and one selection pressure produces one kind of horse. Two independent loci give four corners — fast and springy in a storm, fast and flat, and so on — which is four lines a breeder can keep apart.

Planned source: common/genetics/genes/WeatherJumpGene.java