[PR #6158] [MERGED] Spawn eggs used on vines spawn the mob in the vines #6683

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

📋 Pull Request Information

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

Base: main ← Head: fix/6125-spawn-egg-on-vines


📝 Commits (1)

  • cbb7efe Spawn eggs used on vines spawn the mob in the vines

📊 Changes

2 files changed (+4 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+3 -1)
📝 crates/horizon-client/src/game/initial_spawn.rs (+1 -1)

📄 Description

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

What and why

Fixes #6125.

A spawn egg used on vines put the mob a block out in the air, where it fell instead of catching the vines.

Vanilla's SpawnEggItem.useOn picks the spawn position from the clicked block's collision shape: state.getCollisionShape(level, pos).isEmpty() ? pos : pos.relative(face) (26.3 bytecode, offsets 248–276). Vines, grass, flowers and other blocks without collision take the mob themselves; Horizon always used the block on the clicked face.

Game::use_spawn_egg now uses the clicked block when collision_empty (the existing initial_spawn.rs helper, getCollisionShape with an empty context, made pub(super)) says it has no shape. The fluid-source path (SpawnEggItem.use) is unchanged.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

  • net.minecraft.world.item.SpawnEggItem.useOn(UseOnContext): the spawn position above, then EntityType.spawn(.., spawnPos, SPAWN_ITEM_USE, true, !pos.equals(spawnPos) && face == UP).

No harness or unit test: the change is which block position the existing spawn path gets.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on DESKTOP-G0M27UC, against upstream/main at abbfe4996, 5 min 18 s)

Check Result
Scope ✅ 2 files, +4 −2
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 584 passed (3 min 12 s)
rustfmt ✅ (16 s)
clippy ✅ (15 s)
tests: horizon-client ✅ 1767 passed (1 min 27 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Not checked in game on this machine: the vanilla data isn't prepared here.

🤖 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/6158 **Author:** [@breachato](https://github.com/breachato) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/6125-spawn-egg-on-vines` --- ### 📝 Commits (1) - [`cbb7efe`](https://github.com/horizon-rust/horizon/commit/cbb7efe894a457f82fab0a727fee41897dd61bb2) Spawn eggs used on vines spawn the mob in the vines ### 📊 Changes **2 files changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+3 -1) 📝 `crates/horizon-client/src/game/initial_spawn.rs` (+1 -1) </details> ### 📄 Description > 🤖 Opened by breachato's AI agent (Claude Code, Claude Opus 5.5), not by breachato personally. ## What and why Fixes #6125. A spawn egg used on vines put the mob a block out in the air, where it fell instead of catching the vines. Vanilla's `SpawnEggItem.useOn` picks the spawn position from the clicked block's collision shape: `state.getCollisionShape(level, pos).isEmpty() ? pos : pos.relative(face)` (26.3 bytecode, offsets 248–276). Vines, grass, flowers and other blocks without collision take the mob themselves; Horizon always used the block on the clicked face. `Game::use_spawn_egg` now uses the clicked block when `collision_empty` (the existing `initial_spawn.rs` helper, `getCollisionShape` with an empty context, made `pub(super)`) says it has no shape. The fluid-source path (`SpawnEggItem.use`) is unchanged. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference - `net.minecraft.world.item.SpawnEggItem.useOn(UseOnContext)`: the spawn position above, then `EntityType.spawn(.., spawnPos, SPAWN_ITEM_USE, true, !pos.equals(spawnPos) && face == UP)`. No harness or unit test: the change is which block position the existing spawn path gets. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on DESKTOP-G0M27UC, against upstream/main at abbfe4996, 5 min 18 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +4 −2 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 584 passed (3 min 12 s) | | rustfmt | ✅ (16 s) | | clippy | ✅ (15 s) | | tests: horizon-client | ✅ 1767 passed (1 min 27 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Not checked in game on this machine: the vanilla data isn't prepared here. 🤖 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:24:53 +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#6683
No description provided.