Spawn eggs used on vines spawn the mob in the vines

SpawnEggItem.useOn spawns in the clicked block itself when its collision
shape is empty (vines, grass, flowers) and only otherwise in the block on the
clicked face. Horizon always took the face's block, so an egg used on vines
put the mob a block out in the air, where it fell instead of climbing.

Fixes #6125

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
breachatoandClaude Opus 5.5 committed 2026-11-01 18:15:41 +01:00
1 parent abbfe4996b
commit cbb7efe894
2 files changed
+4 -2

No files matched your search

+3 -1
View File
@@ -5882,7 +5882,9 @@ impl Game<'_> {
}
return Ok(true);
}
let p = if fluid {
// useOn: a clicked block without a collision shape (vines, grass)
// takes the mob itself, any other the one on the clicked face.
let p = if fluid || self.collision_empty(hit.pos) {
hit.pos
} else {
[
@@ -207,7 +207,7 @@ impl Game<'_> {
self.process_level_events()
}
/// The block at `pos` has no collision shape.
fn collision_empty(&self, pos: [i32; 3]) -> bool {
pub(super) fn collision_empty(&self, pos: [i32; 3]) -> bool {
let mut scene = SceneCollisions {
world: &self.world,
binding: self.collision,