Magical gene / phase 3 + effects
Waterborn
Neon-blue streaks through the mane and tail, and a horse that walks on the surface of water instead of wading. It leaves a trail of blue sparks where it treads, and a tamed mare can be milked with an empty bucket for a bucket of water. Waterborn is the mod’s first data-driven gene to ship and the first to carry an effects block — it is a JSON file, not a Java class.
The effects
The behaviour half is an effects block — three of the
five effect verbs. common/ parses it;
the NeoForge translator runs it.
"effects": [
{ "type": "traversal", "flag": "walk_on_water", "when": { "flag": "adult" } },
{
"type": "emitter", "kind": "particle", "shape": "trail", "anchor": "feet",
"trigger": { "on_move": {} },
"particle": "minecraft:dust", "color": "#1ec8ff", "chance": 0.7
},
{
"type": "yield",
"trigger": { "on_interact": "minecraft:bucket" },
"consumes": "minecraft:bucket", "produces": "minecraft:water_bucket",
"cooldown": 2400,
"when": { "all": [ { "flag": "sex_female" }, { "flag": "tamed" } ] }
}
]
- walk_on_water
- An adult Waterborn horse rides at the surface instead of sinking —
the
when: { flag: adult }gate means a foal wades normally. This one is an approximation: the translator adds buoyancy and clears the fall each tick, it does not build a solid collision plane, so the feel (edges, bobbing, a rider’s head dipping) is the thing to watch in-game. - the dust trail
- A
minecraft:dustparticle in#1ec8ffat the hooves, firedon_move— only while the horse is moving on the ground — with a per-tick chance of 0.7. Nothing while standing or swimming. Confirmed working 2026-09-02. - the mare milking
- Right-click a tamed mare with an empty bucket and it
becomes a water bucket; the interaction is eaten so no mount happens, and
a
cooldownof 2400 ticks (2 minutes) throttles it. Thewhenissex_femaleandtamed, so a stallion or an untamed mare just gets mounted as usual. A non-creative player’s bucket is consumed.
Effects touch neither pigment nor RGB, so Waterborn being a magical-phase gene (for its coat layer) is unrelated to its effects. A natural gene could carry the same block.
- Gene key
- horsegenetics.waterborn
- Alleles
- Wtb n
- Outcomes
- wild,
waterborn - Shows when
Wtb/n,Wtb/Wtb- Default allele
- n
- Wild frequency
- 1 in 90 per allele → ~1 wild horse in 45 shows it
- Founder draws
- 1 × nextFloat()
- Deterministic
- no when expressed — the stripe field varies per horse
- Epigenetic draws
- 1 long (stripe seed) + 1 nextFloat (stripe spacing), off the
Wtbcopy - Priority
- 215 — a data-driven magical gene, slots before Test in
magicalOrder() - Stripe colour
#1ec8ff(30, 200, 255), 92% of the way there- Effects
traversalwalk_on_water,emitterdust trail,yieldmare→water bucket
Confirmed: the neon streaks in the mane and tail render, and
the blue particle trail works. Still unverified:
walk_on_water (an approximation — surface buoyancy, not a
solid plane) and the tamed-mare milking. Checklist item is
To be verified §13.
The coat: neon streaks in the mane and tail
The visual half is one ordinary magical coat layer: a STRIPES mask
restricted to the HAIR parts (mane + tail) crossed with a
TOWARD op that walks each covered texel 92% of the
way to #1ec8ff.
{
"name": "neon blue stripes down the mane and tail",
"masks": [
{ "type": "STRIPES", "parts": [ "HAIR" ], "seed": "$stripeSeed",
"spacing": "$stripeSpacing", "duty": 0.4, "warp": 0.8 }
],
"op": { "type": "TOWARD", "color": "#1ec8ff", "strength": 92, "opacity": 100 }
}
TOWARD rather than TINT for the same reason
mane colour uses it: it reads what each
strand currently looks like and steps it toward the target, so the mane keeps its
light and dark instead of turning into a flat slab, and it reads the same on a
black, a chestnut or a cremello. opacity: 100 means the streaks also
show on a dominant-white horse.
Two knobs make the pattern per-horse, so no two Waterborn manes are identical:
| Knob | Range | Effect |
|---|---|---|
stripeSeed | a nextLong() | seeds the BodyStripes field — where the streaks fall and how the noise warps them. |
stripeSpacing | 1.6–2.8 body units | centre-to-centre gap. Tight, so the hair reads as several thin streaks rather than one band. duty 0.4 = 40% of each period is streak; warp 0.8 bends them off-straight. |
Because a knob is in play, a visible Waterborn is non-deterministic:
each horse bakes its own texture, keyed by the seed on the Wtb copy
it carries, and a foal that inherits that copy inherits the exact streak pattern.
The first gene that ships as a file
Every other gene is either a hand-written Java class or a file the player drops in
themselves. Waterborn ships inside the mod: a classpath index
(neoforge-26.1.2/src/main/resources/horsegenetics/genes/index.json)
that GeneSpecLoader.fromClasspath() registers from the mod
constructor. Suntouched was added beside it
the same way. It was done to make the effects work testable without a config
drop, and it breaks the standing “no gene ships by default” rule on
purpose — with the two shipped genes:
- the in-game genotype code is 13 segments, and shorter saved horses will not load;
- the
GenotypeCatalogcount is roughly 4× its no-gene size (each shipped DOMINANT two-allele gene doubles it); :common:testis unaffected — that index is in the NeoForge module’s resources, not on the common test classpath, so the golden test and the 11-built-in count still hold.
To turn Waterborn off, drop it from index.json and delete the file.
The horse dimension is due for an overhaul regardless.
Not modelled yet
- One stripe colour and one strength; no per-horse colour variation. An allelic series (teal / indigo / white-water) would make it the first shipped data-driven gene with more than two alleles.
- The
walk_on_lavasibling flag exists in the format but the translator does not wire it; an ember-born counterpart is the obvious pair. - The gene creator cannot edit an
effectsblock yet — Waterborn’s was hand-written.
common/src/main/resources/horsegenetics/example-genes/waterborn.json
(and the shipped copy under neoforge-26.1.2/…/resources/horsegenetics/genes/)