[PR #5913] [MERGED] Frog: a magma cube it eats is drawn in and vanishes, as vanilla #6556

Closed
opened 2026-11-03 06:22:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5913
Author: @xFedeT
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/frog-animations


📝 Commits (2)

  • b45e1c9 Frog: the tongue sets its target's velocity and a killed target vanishes at once
  • 0c69153 Frog: a mob eaten by a frog still drops its loot

📊 Changes

3 files changed (+49 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+34 -0)
📝 crates/horizon-client/src/mobs.rs (+10 -0)
📝 crates/horizon-client/src/mobs/frog.rs (+5 -2)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally.

Part of #5864 (the first of its two points: the magma cube a frog eats).

What vanilla does

ShootTongue.tick, when the target is within 1.75 blocks, does target.setDeltaMovement(target.position().vectorTo(body.position()).normalize().scale(0.75)): the target's velocity is replaced and it is drawn toward the frog. After the catch animation eatEntity hurts the target and, if it died, calls target.remove(KILLED): it is removed at once, with no death animation.

What was wrong

  • The pull was sent as MobEvent::Push, which adds to the target's velocity, so a cube already jumping kept its own motion.
  • A target that died stayed in the world and played its death animation (the 20-tick fall over) next to the frog, instead of vanishing.

What changes

  • MobEvent::SetVelocity (replace the velocity) and MobEvent::RemoveKilled (remove a mob that is no longer alive, with no death animation); mobs/frog.rs uses them; handlers in game/creatures.rs.

Verification

  • tools/parity.py mob_ai: passes. pr_ready --quick: fmt, clippy, 1678 horizon-client tests, Python tests pass.
  • Live, offscreen game (horizon-ctl, scratch homes): a size-1 magma cube 3.03 blocks from a frog was drawn in (x 3.03 to 1.61 toward the frog at x 0) and disappeared at once with DeathTime 0.

Not done

The issue's second point, the frog's walking animation looking different, is not changed here. FrogModel.setupAnim (walk factor 1.5, scale 2.5, swim 1.0 and 2.5) and Frog.updateWalkAnimation (target speed min(distance * 25, 1) and 0 while the jump plays) match body_anim.rs::frog and frog::walk_target line by line, so the difference is not in what I could check by reading; it needs a comparison against a vanilla client.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/5913 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/frog-animations` --- ### 📝 Commits (2) - [`b45e1c9`](https://github.com/horizon-rust/horizon/commit/b45e1c9dd34b138d0fe7589baaf9c873694a3a9c) Frog: the tongue sets its target's velocity and a killed target vanishes at once - [`0c69153`](https://github.com/horizon-rust/horizon/commit/0c69153b31185d3d5ae766e166eeca9aee6852e5) Frog: a mob eaten by a frog still drops its loot ### 📊 Changes **3 files changed** (+49 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+34 -0) 📝 `crates/horizon-client/src/mobs.rs` (+10 -0) 📝 `crates/horizon-client/src/mobs/frog.rs` (+5 -2) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Claude Sonnet 5.5), not by xFedeT personally. Part of #5864 (the first of its two points: the magma cube a frog eats). ## What vanilla does `ShootTongue.tick`, when the target is within 1.75 blocks, does `target.setDeltaMovement(target.position().vectorTo(body.position()).normalize().scale(0.75))`: the target's velocity is replaced and it is drawn toward the frog. After the catch animation `eatEntity` hurts the target and, if it died, calls `target.remove(KILLED)`: it is removed at once, with no death animation. ## What was wrong - The pull was sent as `MobEvent::Push`, which adds to the target's velocity, so a cube already jumping kept its own motion. - A target that died stayed in the world and played its death animation (the 20-tick fall over) next to the frog, instead of vanishing. ## What changes - `MobEvent::SetVelocity` (replace the velocity) and `MobEvent::RemoveKilled` (remove a mob that is no longer alive, with no death animation); `mobs/frog.rs` uses them; handlers in `game/creatures.rs`. ## Verification - `tools/parity.py mob_ai`: passes. `pr_ready --quick`: fmt, clippy, 1678 `horizon-client` tests, Python tests pass. - Live, offscreen game (`horizon-ctl`, scratch homes): a size-1 magma cube 3.03 blocks from a frog was drawn in (x 3.03 to 1.61 toward the frog at x 0) and disappeared at once with `DeathTime` 0. ## Not done The issue's second point, the frog's walking animation looking different, is not changed here. `FrogModel.setupAnim` (walk factor 1.5, scale 2.5, swim 1.0 and 2.5) and `Frog.updateWalkAnimation` (target speed `min(distance * 25, 1)` and 0 while the jump plays) match `body_anim.rs::frog` and `frog::walk_target` line by line, so the difference is not in what I could check by reading; it needs a comparison against a vanilla client. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:22:54 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#6556
No description provided.