BeehiveBlockEntity (crate::beehive): up to three bees stored as entity
tags, out when their time is up (not at night, in the rain or through a
blocked front unless in an emergency), honey for nectar, the flower they
knew; vanilla's bees / flower_pos save format. Bees find a hive with room
(BeeLocateHiveGoal), fly home and go in (BeeEnterHiveGoal through
MobEvent::EnterHive). In the game hives tick, breaking one lets the bees
out angry unless smoked, fire empties it, dispensers release them.
mob_ai: bee_hive_night, _rain, _morning and _honey match vanilla.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A port of vanilla 26.3 Bee: FlyingMoveControl and flying navigation,
hover wandering, flower search and pollination (nectar), growing crops,
tempting and breeding, persistent anger with the hurt-by alert, the sting
(poison, stinger lost, later death), drowning, staying home at night and
in rain, roll, textures and NBT. Hives as homes are not simulated yet.
FlyingMoveControl clamps the pitch like Entity.setXRot, so a rotlerp
that wraps to 359 gives 90 as in vanilla.
Mob AI parity: 9 bee scenarios, 3609/3609 ticks; full harness 120/120.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bats fell into the generic fallback AI and walked like land animals; their
animation states were never started. Port vanilla Bat: hanging from a solid
block until a player comes within 4 blocks or the block goes, the take-off
level event, customServerAiStep's flight towards random nearby air, Bat.tick
(held to the ceiling while resting, vertical speed scaled by 0.6 in flight),
setupAnimationStates (flying and resting keyframes), waking when hurt,
BatFlags in the save, no fall damage, movement events without sounds, the
lower voice pitch, and no omnidirectional air drag (vanilla gives that only
to bees, parrots and sulfur cubes).
Mob AI parity harness: six bat scenarios, 6/6 match (1906/1906 mob-ticks).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Striders fell into the generic fallback AI, whose FloatGoal jumped them
up and down in lava. Port vanilla Strider: its goals (no FloatGoal,
StriderGoToLavaGoal, RandomStrollGoal every 60 ticks, LookAtPlayerGoal for
striders), floatStrider, standing on lava sources through the living
collision context and the half-block liquid shape, travelling in air where
lava holds it up, StriderPathNavigation's lava destinations, the walk target
value, going cold (suffocating speed modifier, cold texture) away from warm
blocks, the happy/retreat sounds and a lava-proof checkFallDamage.
Mobs now keep Entity.mainSupportingBlockPos from their last move, as
getBlockStateOnLegacy reads it.
Mob AI parity harness: five strider scenarios, 5/5 match (1105/1105
mob-ticks; 0/5 and 5/1105 before).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Animal.mobInteract plays playEatingSound(), which is empty in Animal and
overridden only by armadillos, cats, foxes, frogs, goats, pigs, sniffers and
sulfur cubes (plus nautili). Horizon fell back to entity.generic.eat for every
other animal (cows, sheep, chickens, rabbits, turtles, bees...), with a level
random pitch instead of each class's volume and pitch.
- mobs::ai::eating_sound: the overrides with their exact volume and pitch
(makeSound with the voice pitch, playSound(1, 1), or Level.playSound with
Mth.randomBetween(0.8, 1.2)); silent otherwise.
- mobs::ai::feed_animal: Animal.mobInteract's food part, shared by the game
and the mob AI probe; Strider.mobInteract adds entity.strider.eat.
- AgeableMob.ageUp(seconds, true): forcedAge and the forced-age particle
timer, whose positions draw from the mob's random on the server.
- Tame wolves and cats healed with food: TamableAnimal.feed (wolves silent).
- Parrots: Parrot.isFood is false; wild ones take parrot food with
entity.parrot.eat and a one-in-ten taming chance.
- Baby pigs and chickens use their sound variant's baby_sounds.
The mob AI harness gains a `feed TICK MOB ITEM` event (the oracle calls the
real Animal.mobInteract) and feeding scenarios for adult and baby cows, pigs,
sheep and chickens.
Fixes#68
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The golem's goals are replaced by vanilla's brain (core and idle activities,
the transport cooldown, look-at-player-sometimes, stroll or wait), and
TransportItemsBetweenContainers moves into the library: nearest wanted
chest in chunk and block entity map order, queueing behind golems with a
chest open, the 60-tick interaction with its states, sounds and opener
counts, picking up and putting down (with vanilla's overcounting), visited
and unreachable positions. Weathering draws from the level random after the
living tick; the spin sound is client-local. mob_ai gains seven copper golem
scenarios that print each golem's state, hand and opened chest and every
chest's contents and openers; all match vanilla.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Warden.nextStep: a step every 0.55 walked; mob steps raise a step
game event, which the mob AI probe delivers to wardens through the
listener the game uses (warden::listen).
- Warden.tick runs the vibration ticker before super.tick.
- The probe applies melee hits on mobs, reads a warden's target from its
brain, and plays the player's death sound for a lethal hit; warden_player
and warden_cow stop before the killing blow.
- getViewVector(0) uses the head's previous yaw, and AirAndWaterRandomPos
the float quarter turn: tempted ghastlings stroll as vanilla's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The parent's half of VillagerMakeLove.tryToGiveBirth (eating, the child's
bed and type, resting) runs in its own tick, before it ages; the partner's
follows as an event. A baby's NearestBedSensor keeps its bed when the
reused path heads elsewhere, as vanilla checks for a POI there. Footsteps
come from the block under the feet (Entity.mainSupportingBlockPos), not
the column below the centre. The oracle faces newborns' heads with their
bodies (LivingEntity draws the head yaw from Math.random), and the breeding
scenarios leave one free bed per section (PoiManager hands them out in hash
order).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gossip and gifts between villagers (TradeWithVillager) move into the
library so the mob_ai probe runs them as the game does; both villagers now
lock their gaze on each other, as lockGazeAndWalkToEachOther does. The
probe reads the oracle's villager flags, prints villager data (food,
inventory, gossip, reputation) and adds babies as they are born. The
oracle seeds TriggerGate's shuffles too, which were left to the clock.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeps both sides' oracle scenarios: the creaking hearts, hurts, leads and
animal flags of parity-base on this branch's entity list, with a heart's
creakings adopted under their creation seed. Restores the villager meeting,
birth and golem-check events the unfinished WIP had begun to replace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Uncommitted changes the agent had in progress when it was stopped on
2026-10-12; may not build or pass its harnesses yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Uncommitted changes the agent had in progress when it was stopped on
2026-10-12; may not build or pass its harnesses yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A lead gives its mob a home at the holder (PathfinderMob.whenLeashedTo)
and every random position helper honours homes (generateRandomPos-
TowardDirection's lean back and GoalUtils.isRestricted), as the happy
ghast's float area now does too. LlamaFollowCaravanGoal keeps 2.1F, a
llama's baby and the breeding experience are drawn from the parent's
random, wolves run from llamas by strength (WolfAvoidEntityGoal), a
growing mob refits its box (fudgePositionAfterSizeChange) and a happy
ghast's new controls want nothing. Scenarios can lead mobs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mobs::creaking_heart is CreakingHeartBlockEntity: the ticker drawn from
the level random, the state following the night and the logs, the
protector spawned with SpawnUtil.trySpawnMob (five tries within 16
blocks, on top of a collider, then EntityType.create's yaw and
Mob.finalizeSpawn's follow range bonus), its sounds, letting it go by
day, beyond 34 blocks or with a player stuck in it, and when a player
hurts it the trails and the resin spread over the logs. The game ticks
its hearts through it, and its level random now carries on between
ticks.
The mob AI harness gains hearts: the oracle places them when a scenario
starts, ticks block entities after the mobs, seeds the creakings the
level creates and adds them to the scenario, prints each heart's state
and block entity, and lets the player hit a mob (hurt T I). Five heart
scenarios (night, day, uprooted, no player near, hit twice) match.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mobs set each other's brain memories within the tick (the breed target
and lockGazeAndWalkToEachOther), the partner rests and forgets at the
birth, and an animal in love draws its heart particle randoms. The adult
happy ghast's TemptGoal.ForNonPathfinders ticks every other tick and
follows creative players. The mob AI scenarios can give the player an
item and a mob love, taming, an age or a llama strength.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Eight scenarios: a breeze alone and fighting a player near, inside and
beyond its jump circle; a creaking alone, watched, unwatched, and woken
then hunting once the player turns away (a new player turn= option).
The oracle now faces the player +z with its head too (it kept a random
head yaw from its creation, which the breeze's jump target reads).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SnifferAi and HappyGhastAi as vanilla's Brain runs them: the sensors and
their scan rates, the activities and their requirements, and every
behaviour (AnimalPanic, MoveToTargetSink, FollowTemptation, AnimalMakeLove,
LookAtTargetSink, RunOne and the sniffer's scenting, sniffing, searching,
digging, rising and happy states) in availableBehaviorsByPriority order.
Adds AirAndWaterRandomPos and the mob AI scenarios for llamas, sniffers
and happy ghasts. The brain is not ticked yet.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drowned register Zombie's goals and then Drowned.addBehaviourGoals (go to
water, trident and melee attacks with okTarget, go to beach, swim up,
RandomStrollGoal) with DrownedMoveControl, Drowned.travelInWater and
AmphibiousPathNavigation. Skeletons get their bow from finalizeSpawn and
pick the bow goal or the AbstractSkeleton$1 melee goal from the held item,
as reassessWeaponGoal does. Monster.aiStep adds 2 to noActionTime in bright
light (raiders always), which stops RandomStrollGoal; LookAtPlayerGoal
supports Mob.class targets and InteractGoal, used by the wandering trader
(with vanilla's AvoidEntityGoal order), illagers, ravagers and vexes.
Entities below the world take 4 damage a tick instead of vanishing, water
travel uses the 0.8F/0.6F/0.3F float constants, and MobWorld carries the
level's sea level.
The oracle refreshes the player's water state after placing it (it is never
ticked, so isInWater kept the previous scenario's value) and keeps its world
under the harness build directory, deleting it before halting instead of
leaving /tmp/horizon-mob-ai* behind. The probe reports KILLED removals.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Zombies (and husks, drowned, zombie villagers, zombified piglins) now
register ZombieAttackTurtleEggGoal first, as vanilla does, so their goal
selector draws the same random numbers. LivingEntity.pushEntities runs in
aiStep against the player and other mobs, with pushes to other mobs applied
at once as Entity.push does (replacing the post-tick push_apart). Spider
target goals check the light before their random interval, LookAtPlayerGoal
uses the non-combat targeting conditions, raiders register the
PatrollingMonster/Raider goals before their own, and the witch runs its
aiStep (heal cooldown, drinking, particle roll) before super.aiStep with
NearestHealableRaiderTargetGoal's nextBoolean.
The mob AI oracle's player is now a fully loaded, hurtable client: its
connection starts with a 60-tick load timer and 26.3 moved the hurt cooldown
to damageCooldownTime, both of which only ServerPlayer.tick counts down, so
whether mobs could hurt the player depended on the scenario order. The probe
reports the player's hurt sound, and an rng-trace feature records the call
sites of Horizon's mob random draws next to the oracle's trace.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/parity.py traces each harness (its Python, Java oracle sources and
the Rust sources of the probes it runs, from Cargo's dep-info) and reruns
it only when one of those, the vanilla artifacts or the toolchains change.
Harnesses run in parallel within the available memory, and their probes
build without LTO and with 16 codegen units into .local/parity-target: a
one-line change rebuilds every horizon-world probe in 3 seconds instead of
122. The full suite takes about 20 minutes instead of an hour.
tools/gate.py is the check a branch passes before integration, and
tools/supervise.py manages the per-area worktrees: status, new worktrees,
saving unfinished work, and integrating a branch only when the gate passes.
Harnesses find probes through lab.cargo_target() instead of a hard-coded
target/, the save round-trip harness builds the binaries it launches, and
the mob AI harness now fails on divergences like every other harness
(--report-only keeps the old behaviour). Debug builds keep line tables
only, so worktrees stay small.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mth.atan2 builds its tables with StrictMath.asin (fdlibm, ported) and
HotSpot's cos; the controls multiply by the folded RAD_TO_DEG float
constant. Mob.checkDespawn runs before the tick and, in 26.3, persistent
mobs only reset their idle time near a player. NearestAttackableTargetGoal
always requires a line of sight and ignores mustReach when searching.
MeleeAttackGoal starts its canUse clock at game time 0. The harness now
records every random draw of the vanilla mobs with its caller, the random
state per tick, and starts each scenario at game time 1000.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VanillaMobAiOracle runs vanilla mobs in a real headless flat server level,
ticking them as ServerLevel does while the rest of the level stands
still; mob_ai_probe replays the same scenarios on Horizon. Both print each
mob's AI-visible state every tick (position, motion, rotations, goals,
targets, navigation, controls, input, brain activities and memories,
sounds) and tools/test_mob_ai_parity.py reports the first divergence.
Fixes found: float entity dimensions, Mth.sin/cos in moveRelative and the
strafe/swim controls, Mth.atan2 and the float thresholds of the controls,
RandomPos float constants, the ambient sound clock starting at zero, hurt
and death sounds drawn from the mob's own random (also when burning),
knockback for every damage type not tagged no_knockback, Entity.move's
collision flags, restitution and footstep/swim sounds, and mob sound
volumes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>