Farmer's Delight's calls against existing hooks
The open rows of the Portizon map of Farmer's Delight's mixins (#1027; the full 34-point table is reservedbytes' comment on that issue), each exercised against the hook Horizon already has. Each row names what Farmer's Delight's injection does at its vanilla method, the hook's contract and the test that runs it. No Farmer's Delight-specific hook is proposed. The three contract mismatches the map found have their own issues: can_eat changing the answer (#1897), the attack strength at the blow (#1898) and the dispenser's behaviour by the facing block (#1899).
From the modding book of arismoko/horizonbfbda6a
Prefix API = crates/horizon-mod-vocab/src/; Game = crates/horizon-client/src/game/.
CampfireBlock#isSmokeSource,@Injectat HEAD, cancellable: answers for its own blocks.- Hook and contract
BlockPart::(APIsmoke_ source hooks/):base.rs:3327 replace, scoped to the block under the campfire, asked on an authoritative server as the campfire is placed or that block changes.- Status
- Works
- Evidence
- Game
modding/: a Part's yes makes a campfire over stone a signal fire, and a Part's no over a hay bale replaces vanilla's yes, through the shape update when the block under it changes. The map's location note (only the hook's rustdoc names the method) is settled:native_ smoke_ source_ tests.rs:44 horizon-worldlevel/issurvive.rs:504 CampfireBlock.isSmokeSourceand asks the hook.
LivingEntity#hurtServer,@ModifyVariableat HEAD: changes the damage amount.- Hook and contract
living_(APIincoming_ damage hooks/):base.rs:906 cancel, withcontainer.set_; fires pastnew_ damage hurtServer's guards.- Status
- Works
- Evidence
- Game
modding/: a listener sets 4 on a 10-point hit and the pig keeps 6 health, so the changed amount is the one dealt. The map's "contract mismatch" read the hook's name (native_ damage_ tests.rs:119 cancel), not its mutable container. Farmer's Delight changes the amount before the guards, and the hook runs after them. In vanilla 26.3'shurtServer, the guards (isInvulnerableTo,isDeadOrDying, fire damage under Fire Resistance) return before the method first reads the amount, so the dealt damage is the same.
LivingEntity#knockback(both overloads),@ModifyVariableat HEAD, ordinal 0: changes the strength.- Hook and contract
living_(APIknockback hooks/):base.rs:2069 cancel, with mutablestrength,xandzon the raw strength before knockback resistance.- Status
- Works
- Evidence
- Game
modding/: a listener doubles the strength (native_ knockback_ tests.rs:91 :42) and the push the game applies carries 0.8 for 0.4 (:142). The map's "contract mismatch" read the hook's name, as above.
MinecraftServer#onGameRuleChanged,@Injectat HEAD: is told a rule changed.- Hook and contract
game_(APIrule_ changed hooks/):game_ rule_ changed.rs:15 listen, with the rule, the new value and the actor.- Status
- Works
- Evidence
- Game
modding/: settingnative_ level_ world.rs:523 keep_tells a listener the rule, that no player caused it, and the whole rule set with the new value. The map found no candidate, because it tagged the method to twoinventory Hubsetters rather than to the hook.
Cake eligibility
can_eat also supplies cake and candle cake's Player.canEat(false) answer. The event receives the currently held stack, or None for an empty hand, not a synthetic cake item. Answer Some(false) to refuse a bite even when hungry, or Some(true) to allow a full player to eat. Leaving the answer unset keeps vanilla hunger and creative-mode behavior.
Gaps
The outcome tests in this table do not establish exact function-entry fidelity. In particular, listening once to living_knockback is not equivalent to injecting both delegated overloads; #2753 tracks the entry pair and #2767 tracks its cross-target API admission. For hearing refused damage attempts without changing the amount, use the existing invulnerability observation, with its explicit vanilla exclusions (#2752). living_incoming_damage already allows amount changes before the cooldown comparison; no new amount-bearing entry event is needed for that use case.
Edit this page on GitHub · Spotted something wrong? Open an issue .