Magical gene / no coat effect

Magic water breathing

How long the horse lasts under water before it starts to drown. The graded counterpart of the underwater_breathing traversal flag, which is absolute — and independent of magic swim speed, because crossing a river quickly and surviving the bottom of a lake are different problems.

Crossing two of them

What it does

A gilled horse holds its breath longer — one copy is worth about a quarter more time, two are worth half again and often much more. A shallow-lunged horse drowns sooner by the same measure. Neither swims any faster; this is lung capacity, not propulsion.

It is a real hazard in one direction and a real capability in the other, and both are completely invisible on dry land. An owner usually finds out which one they have the first time it matters.

What you can catch

About a quarter of wild horses carry one copy, split evenly between the two alleles, and none carries two. A horse that can genuinely be ridden along a lake bed is a bred animal.

Health

A doubled shallow-lunged horse drowns markedly faster than an ordinary one and there is nothing about it to see. It is not a disorder — the server’s health switch does not govern it, because a short breath is the rule of this gene rather than a defect — but it is the one combination here that can kill a horse its owner was not worried about.

Its gene carrot

Gene key
horsegenetics.magic_water_breathing
Alleles
Gil gilled, Shal shallow-lunged, n
Priority
145 — the magical body-stat band
Reaches the game as
a breath effect
Coat effect
none, ever
Newly built, not yet play-tested

Nothing on this page has been seen in game. The translator was written against the 26.1.2 sources and is flagged as unverified in its own comments. Checklist on To be verified.

Graded, beside an absolute flag

The format already had underwater_breathing: a traversal flag that refills the horse’s air every tick and can never be beaten. This locus is the dial, and the two are meant to coexist. A horse that cannot drown does not care how slowly it would have, and the composition needs no special case — the flag simply wins by refilling.

One expression, both directions

Vanilla takes one point of air per submerged tick. For the horse to last factor times as long the drain has to be 1 / factor, so every submerged tick the translator hands back 1 - 1 / factor — positive for a long-breathed horse, negative for a short-breathed one. One line covers both directions, which is the reason to write it this way rather than as two cases.

neoforge/server/GeneAbilityHandler.java
double owed = BREATH_DEBT.getOrDefault(id, 0.0) + (1.0 - 1.0 / b.factor());
int whole = (int) owed;
if (whole != 0) {
    horse.setAirSupply(Math.min(horse.getMaxAirSupply(), horse.getAirSupply() + whole));
    owed -= whole;
}
BREATH_DEBT.put(id, owed);

Air is an int and that quantity is not, so the fraction accumulates per horse until it is worth a whole point. The map is cleared when the horse surfaces and when it leaves the level.

Why not the oxygen_bonus attribute

Vanilla has one, and it does very nearly this: it gives a 1 / (bonus + 1) chance per tick of not consuming air, which multiplies breath time by bonus + 1. It was rejected for two reasons.

  • It reaches one direction only. There is no negative bonus that drowns a horse faster, so the shallow-lunged allele would have needed a second mechanism anyway.
  • It rolls a die every tick, so two horses with identical genotypes would drown at different times. This locus is meant to be bred for, and a bred number that does not hold still is not one.

The pair it forms with swim speed

Two loci, independent draws, and between them they describe every useful kind of water horse: the ferry (fast, ordinary lungs), the diver (ordinary speed, long breath), and the one that is both, which nobody catches.

They were deliberately not built as one gene with two knobs. A single locus would mean the two facts were inherited together for ever, and the interesting horses are exactly the ones where they came apart — a beautiful swimmer that cannot stay under, or a horse that can walk a lake bed at a crawl.

What breeding does to it

The percentage on each copy drifts slightly at every breeding, so a line selected for long breath keeps improving on the horses it started from rather than converging on them. That is the same mechanism every epigenetic locus here uses, and it is why the wild range is a starting point rather than a ceiling.

Source: common/genetics/genes/MagicWaterBreathingGene.java, common/genetics/genes/AbstractMagicFactorGene.java