[GH-ISSUE #3383] Pick Block on entities does not grant spawn eggs in Creative mode #954

Closed
opened 2026-11-02 15:43:07 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @josegil1909 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3383

Description

In Creative mode, aiming at a living entity/mob (such as a cow, pig, sheep, or other animal) and pressing the middle mouse button (Pick Block) fails to grant the entity's spawn egg to the player.

Steps to reproduce

  1. Enter a world in Creative mode.
  2. Aim the crosshair directly at any animal/mob (e.g. Cow, Pig, Sheep).
  3. Press the middle mouse button (Pick Block).

Expected behavior

As in vanilla Minecraft (Creative mode), pressing Pick Block on a mob selects or adds the corresponding spawn egg (e.g., minecraft:cow_spawn_egg) to the player's hotbar.

Actual behavior

Nothing happens; the mob is not recognized, and no spawn egg is added to or selected in the hotbar.

Context & Technical Notes

Commit f92cf816b ("Pick blocks and entities on the server like vanilla") introduced PickItemFromEntity, pick_entity_hit, and entity_pick_result. However:

  • Entity raycasting via mob_hit() and before_block() can fail to hit the mob's bounding box without pick radius expansion or is eclipsed by underlying block checks.
  • On the server side, when PickItemFromEntity is received, guest_pick_item invokes pick_item::pick, but newly added creative stacks do not immediately reflect into the client's held hotbar slot.

Environment

  • OS: Linux (Ubuntu 24.04, Wayland)
  • Horizon build: v0.2.95 / v0.2.96 (aligned with main)
  • Game mode: Creative
Originally created by @josegil1909 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3383 ## Description In Creative mode, aiming at a living entity/mob (such as a cow, pig, sheep, or other animal) and pressing the middle mouse button (Pick Block) fails to grant the entity's spawn egg to the player. ## Steps to reproduce 1. Enter a world in Creative mode. 2. Aim the crosshair directly at any animal/mob (e.g. Cow, Pig, Sheep). 3. Press the middle mouse button (Pick Block). ## Expected behavior As in vanilla Minecraft (Creative mode), pressing Pick Block on a mob selects or adds the corresponding spawn egg (e.g., `minecraft:cow_spawn_egg`) to the player's hotbar. ## Actual behavior Nothing happens; the mob is not recognized, and no spawn egg is added to or selected in the hotbar. ## Context & Technical Notes Commit f92cf816b ("Pick blocks and entities on the server like vanilla") introduced `PickItemFromEntity`, `pick_entity_hit`, and `entity_pick_result`. However: - Entity raycasting via `mob_hit()` and `before_block()` can fail to hit the mob's bounding box without pick radius expansion or is eclipsed by underlying block checks. - On the server side, when `PickItemFromEntity` is received, `guest_pick_item` invokes `pick_item::pick`, but newly added creative stacks do not immediately reflect into the client's held hotbar slot. ## Environment - OS: Linux (Ubuntu 24.04, Wayland) - Horizon build: v0.2.95 / v0.2.96 (aligned with `main`) - Game mode: Creative
Author
Owner

@d3grando commented on GitHub (Oct 29, 2026):

🤖 Agent: triage by d3grando's AI agent (Claude Code), not by d3grando themselves.

Partly reproduces on Windows 11 (v0.2.97 and main 142388e1c). With an empty selected slot the spawn egg is added and held, which works. With an occupied selected slot the egg goes into another slot but isn't selected. That case is the same cause as #3313: leave_guest in game/lan_actions.rs drops the slot the pick chose. The open PR #3148 (fixes #3031) changes exactly that. The entity raycast itself worked in every run; a closer block such as grass is picked first, as in vanilla.

<!-- gh-comment-id:6484074708 --> @d3grando commented on GitHub (Oct 29, 2026): 🤖 Agent: triage by d3grando's AI agent (Claude Code), not by d3grando themselves. Partly reproduces on Windows 11 (v0.2.97 and main 142388e1c). With an empty selected slot the spawn egg is added and held, which works. With an occupied selected slot the egg goes into another slot but isn't selected. That case is the same cause as #3313: `leave_guest` in `game/lan_actions.rs` drops the slot the pick chose. The open PR #3148 (fixes #3031) changes exactly that. The entity raycast itself worked in every run; a closer block such as grass is picked first, as in vanilla.
Author
Owner

@levzzz5154 commented on GitHub (Oct 29, 2026):

🤖 Agent: (written by levzzz5154's AI agent (Claude Code, Claude Opus 5.5), not by levzzz5154 themselves.)

Closing as fixed by #3148 (merged 2026-10-29, commit 0543cf034). The triage above found that on main the entity raycast works and the spawn egg is added and held when the selected slot is empty. The case that failed (an occupied selected slot: the egg went to another slot but wasn't selected) had the same cause as #3313: leave_guest in game/lan_actions.rs dropped the slot the pick chose. #3148 keeps it (lan_actions.rs:680). Please reopen with steps if Pick Block on a mob still does nothing on a newer Nightly.

<!-- gh-comment-id:6504523157 --> @levzzz5154 commented on GitHub (Oct 29, 2026): 🤖 Agent: (written by levzzz5154's AI agent (Claude Code, Claude Opus 5.5), not by levzzz5154 themselves.) Closing as fixed by #3148 (merged 2026-10-29, commit 0543cf034). The triage above found that on main the entity raycast works and the spawn egg is added and held when the selected slot is empty. The case that failed (an occupied selected slot: the egg went to another slot but wasn't selected) had the same cause as #3313: `leave_guest` in `game/lan_actions.rs` dropped the slot the pick chose. #3148 keeps it (lan_actions.rs:680). Please reopen with steps if Pick Block on a mob still does nothing on a newer Nightly.
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#954
No description provided.