Magical gene / phase 3 + effects
Suntouched
A horse lit from within — molten-gold mane and tail that stay bright in
the dark, and a body that casts light like a torch. It sheds a
slow drift of gold sparks as it stands or moves. Suntouched is a data-driven
gene — a JSON file, not a Java class — and it is the
worked example for the glow
effect verb.
The effects
The behaviour half is an effects block — two of the
six effect verbs. common/ parses it;
the NeoForge translator and the client renderer run it.
"effects": [
{
"type": "glow",
"light": 12,
"parts": [ "HAIR" ]
},
{
"type": "emitter", "kind": "particle", "shape": "point", "anchor": "body",
"trigger": { "interval": 6 },
"particle": "minecraft:dust", "color": "#ffcf47", "chance": 0.35
}
]
- the cast light (
light: 12) - The server keeps a single
minecraft:lightblock at light level 12 trailing the horse — moved only when the horse walks into a new block, dropped on death / unload / dimension change (EntityLeaveLevelEvent). It is only placed into air, and it is skipped in the horse dimension so the read-only horse dimension doesn’t fill with light blocks. A server crash can orphan one block — the same caveat the portal plots carry. There is nowhen, so a Suntouched horse always glows, foal included. - the emissive mane (
parts: ["HAIR"]) - Pure client render.
GeneticCoatTextureFactorybakes a second texture — the coat colour on the mane and tail texels, transparent everywhere else — andEmissiveCoatLayerredraws the model through it at full brightness, so the gold hair keeps glowing with no light on it. The colour is exactly what theTOWARDlayer above painted, so the two never drift. Foal: tail only (no mane part on the foal mesh), matching the coat layer. - the gold-dust aura
- A
minecraft:dustparticle in#ffcf47centred on the horse’sbody, a single point everyinterval= 6 ticks with a per-fire chance of 0.35. Unlike Waterborn’son_movehoof trail, this one fires whether the horse is standing or moving — a steady shimmer rather than a track.
glow and not mob_effect: glowing
minecraft:glowing only draws the entity outline through walls
— it doesn’t light anything and it isn’t gold. Suntouched
wants real illumination and a mane that reads as molten metal in a cave, so
it uses the glow verb, whose
two halves (a world light level, a set of full-bright coat parts) are exactly
those two asks. The mob_effect verb is still there for auras like
dolphins_grace; it just isn’t the right tool for “this
horse shines”.
- Gene key
- horsegenetics.suntouched
- Alleles
- Sntch n
- Outcomes
- wild,
suntouched - Shows when
Sntch/n,Sntch/Sntch- Default allele
- n
- Wild frequency
- 1 in 128 per allele → ~1 wild horse in 64 shows it
- Founder draws
- 1 × nextFloat()
- Deterministic
- yes — no knobs, so every carrier bakes the same gold mane
- Epigenetic draws
- none
- Priority
- 210 — a data-driven magical gene, slots before Waterborn (215) and before Test in
magicalOrder() - Mane colour
#ffcf47(255, 207, 71), 88% of the way there- Effects
glowlight 12 + emissiveHAIR,emittergold-dust aura
Confirmed: the emissive gold mane and tail render (bright
in the dark) and look good, the gold-dust emitter shows, and
the horse lights the area around it. Still unverified: the
light cleaning up on death / unload, the foal case, the horse-dimension
skip, and hard base coats (cremello, dominant white). Checklist item is
To be verified §13.
The coat: a molten-gold mane and tail
The visual half is one ordinary magical coat layer: a PARTS mask on
the HAIR parts (mane + tail) crossed with a TOWARD op
that walks each hair texel 88% of the way to #ffcf47.
{
"name": "molten-gold glow through the mane and tail",
"masks": [
{ "type": "PARTS", "parts": [ "HAIR" ] }
],
"op": { "type": "TOWARD", "color": "#ffcf47", "strength": 88, "opacity": 100 }
}
TOWARD rather than TINT for the same reason
mane colour and
Waterborn use 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 flattening to
a slab, and it reads the same over a black, a chestnut or a cremello.
opacity: 100 means the gold also shows on a
dominant-white horse.
Suntouched carries no knobs, so a visible carrier is
deterministic: every Suntouched horse bakes one shared texture
per base coat, and there is nothing on the Sntch copy for a foal to
inherit beyond the allele itself. It is the first shipped data-driven gene with
no per-horse randomness at all.
Ships as a file, like Waterborn
Suntouched ships inside the mod the same way
Waterborn does: the classpath index
neoforge-26.1.2/src/main/resources/horsegenetics/genes/index.json
now lists suntouched.json and waterborn.json, and
GeneSpecLoader.fromClasspath() registers both from the mod
constructor. With 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 shippedDOMINANTtwo-allele gene doubles it); :common:testis unaffected — the 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. Theexample-genes/suntouched.jsoncopy that the unit tests read is loaded by name, never as a registered gene.
To turn Suntouched off, drop it from index.json and delete the file.
Not modelled yet
- One gold, one strength; no per-horse variation and no allelic series (rose-gold / white-gold / ember).
- The dynamic light is a trailing
minecraft:lightblock, not a proper moving light source — it lags a fast gallop and can’t light a spot already occupied by a block. A mixin-based light would be smoother. - The glow is on all the time. A
when: { flag: "night" }or{ flag: "sky_visible" }gate would make it a day/night trait — the light block clears within a tick ofwhengoing false. - The gene creator cannot edit an
effectsblock — this one was hand-written.
common/src/main/resources/horsegenetics/example-genes/suntouched.json
(and the shipped copy under neoforge-26.1.2/…/resources/horsegenetics/genes/)