[PR #2365] [MERGED] Throw what /give cannot fit from the player's eyes, for that player only #4245

Closed
opened 2026-11-03 04:15:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2365
Author: @kacpherek
Created: 10/26/2026
Status: ✅ Merged
Merged: 10/27/2026
Merged by: @ludovic111

Base: main ← Head: fix/give-overflow-drop


📝 Commits (2)

  • a4ccf20 Throw what /give cannot fit from the player's eyes, for that player only
  • fbc7c62 Merge main into fix/give-overflow-drop

📊 Changes

8 files changed (+55 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+8 -1)
📝 crates/horizon-client/src/entities/fluids.rs (+1 -0)
📝 crates/horizon-client/src/entity_nbt.rs (+7 -0)
📝 crates/horizon-client/src/game.rs (+4 -1)
📝 crates/horizon-client/src/game/commands.rs (+24 -2)
📝 crates/horizon-client/src/game/lan_actions.rs (+9 -2)
📝 crates/horizon-client/src/game/machines.rs (+1 -0)
📝 crates/horizon-client/src/game/remote.rs (+1 -0)

📄 Description

What and why

When a player's inventory could not hold everything /give handed out, the rest was put on the ground at their feet, not moving, and anyone could pick it up. In vanilla the rest is thrown from the player's eyes in the direction they look, can be picked up at once, and only by that player.

Item entities now carry the player they are meant for (Owner in the item's data, as in vanilla). /give throws the leftover from the eyes with the vanilla drop velocity, with no pickup delay and the player as target. Players (the host and LAN or server guests) only pick up items meant for them or for nobody, and items meant for different players do not merge.

Vanilla reference

  • GiveCommand.giveItem: createItemStackToDrop(stack, false, false), setNoPickUpDelay(), setTarget(player.getUUID())
  • LivingEntity.createItemStackToDrop (eye height minus 0.3, 0.3 speed along the look direction)
  • ItemEntity.playerTouch (target == null || target.equals(player.getUUID())), ItemEntity.tryToMerge (Objects.equals(target, other.target)), the Owner tag

Self-check

cargo check -p horizon-client passes.


🔄 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/2365 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/26/2026 **Status:** ✅ Merged **Merged:** 10/27/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/give-overflow-drop` --- ### 📝 Commits (2) - [`a4ccf20`](https://github.com/horizon-rust/horizon/commit/a4ccf205f7872362bb53b9ffd40f038ca8ce5793) Throw what /give cannot fit from the player's eyes, for that player only - [`fbc7c62`](https://github.com/horizon-rust/horizon/commit/fbc7c628f652e1db885cd179c773bf0ea4949279) Merge main into fix/give-overflow-drop ### 📊 Changes **8 files changed** (+55 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+8 -1) 📝 `crates/horizon-client/src/entities/fluids.rs` (+1 -0) 📝 `crates/horizon-client/src/entity_nbt.rs` (+7 -0) 📝 `crates/horizon-client/src/game.rs` (+4 -1) 📝 `crates/horizon-client/src/game/commands.rs` (+24 -2) 📝 `crates/horizon-client/src/game/lan_actions.rs` (+9 -2) 📝 `crates/horizon-client/src/game/machines.rs` (+1 -0) 📝 `crates/horizon-client/src/game/remote.rs` (+1 -0) </details> ### 📄 Description ## What and why When a player's inventory could not hold everything `/give` handed out, the rest was put on the ground at their feet, not moving, and anyone could pick it up. In vanilla the rest is thrown from the player's eyes in the direction they look, can be picked up at once, and only by that player. Item entities now carry the player they are meant for (`Owner` in the item's data, as in vanilla). `/give` throws the leftover from the eyes with the vanilla drop velocity, with no pickup delay and the player as target. Players (the host and LAN or server guests) only pick up items meant for them or for nobody, and items meant for different players do not merge. ## Vanilla reference - `GiveCommand.giveItem`: `createItemStackToDrop(stack, false, false)`, `setNoPickUpDelay()`, `setTarget(player.getUUID())` - `LivingEntity.createItemStackToDrop` (eye height minus 0.3, 0.3 speed along the look direction) - `ItemEntity.playerTouch` (`target == null || target.equals(player.getUUID())`), `ItemEntity.tryToMerge` (`Objects.equals(target, other.target)`), the `Owner` tag ## Self-check `cargo check -p horizon-client` passes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:15:46 +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#4245
No description provided.