Magical gene / no coat effect
Guardian
It does not start anything. But whatever hurts you, within sixteen blocks, has a horse to deal with — and it holds its ground rather than chasing.
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
| Combination | Outcome |
|---|---|
Grd/Grd, tamed | attacks whatever damaged its owner, within 16 blocks |
Grd/Grd, untamed | nothing — it has no owner to defend |
| anything else | nothing |
How it differs from a gladiator
Gladiator attacks anything hostile that comes close, whether or not it concerns you, and stops when you mount. This attacks only what has actually hurt you, and works while you are riding. One is a guard dog; this is a bodyguard.
Health
It fights on your behalf, so it takes damage on your behalf. The same pairing with magic health applies.
- Gene key
horsegenetics.guardian- Alleles
Grdguardian,n- Inheritance
- homozygous recessive
- Reaches the game as
- a
tempereffect on anon_owner_hurttrigger - Coat effect
- none, ever
on_owner_hurt is not a horse-tick effect — it hooks a global event, and on a populated server that event is constant. Early-out before any lookup: check cheaply whether this player owns any horse at all before touching genotypes, abilities or entity searches. Getting this wrong costs on every hit anyone takes anywhere.
A horse that retaliates against a player attacker changes what a fight is on a PvP server, and does it without either player agreeing to it. Gate the retaliation on the server’s PvP setting, and treat player targets as a separate decision from mob targets.
A horse that pursues is a horse that dies forty blocks from its owner, and the owner blames the gene — correctly. Attack what comes within reach and return. Full pursuit and owner-leashed pursuit were both specified and both rejected in design; if a later session wants either, it is reopening a settled call, not filling a gap.
on_hurt and on_owner_hurt are two new entries in a closed set of four. Ender echo wants the first; scheduling the two genes together means the trigger machinery is paid for twice.
Owner, not rider
It defends whoever tamed it, whether or not they are on it. A horse standing in a paddock that comes for the skeleton shooting at its owner across the fence is the behaviour people will remember, and gating on rider instead would throw it away for no gain.
The gene most likely to be somebody’s favourite
Of everything in the behaviour family, this is the one that reads least like a mechanic and most like a relationship — and it is the only locus in the mod whose trigger is something that happens to the player. It is worth the new trigger for that alone.
common/genetics/genes/GuardianGene.java