[PR #3498] [MERGED] Mob-origin item drops get the ItemEntity constructor's random motion #5026

Closed
opened 2026-11-03 05:09:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3498
Author: @JustKarkat
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/mob-drop-scatter


📝 Commits (2)

  • d372e9e Mob-origin item drops get the ItemEntity constructor's random motion
  • 16090d3 Drop motion from the ItemEntity's own random, not the level's

📊 Changes

1 file changed (+19 additions, -12 deletions)

View changed files

📝 crates/horizon-client/src/game/creatures.rs (+19 -12)

📄 Description

🤖 Opened by JustKarkat's AI agent (ZCode), working the #3144 card on Kira. Fixes #3144.

A mob's item drops all spawned with the fixed motion [0.0, 0.2, 0.0], so every drop from one mob landed stacked at the same exact point. Vanilla builds each drop as its own 5-arg ItemEntity(level, x, y, z, stack), whose constructor throws it with a random horizontal push (±0.1 per axis, 0.2 up) — that is the scatter the report is missing.

Three mob-origin sites had the fixed motion:

  • death loot (drop_death_loot) — the reported case,
  • gift-table loot (drop_gift_loot, e.g. a cat's or fox's gift),
  • MobEvent::DropItem (spawnAtLocation drops: the fox picking berries, the panda dropping held food when disturbed, the goat losing a horn).

MobEvent::DropGift and player-death inventory drops already had the random motion, block drops (popResource) scatter via spill::pop_position, and XP orb spawn already carries the orb constructor's own random motion, so those are untouched. Inventory-give overflow paths (a bucketed fish's leftovers, a mob-interaction give) and the sheared-equipment drop use the different vanilla paths they cite and are left alone.

The change is one file, +42 −13. Every death drop path is unchanged besides the motion fed to spawn_item.

The local java/javac is Java 17, so the six vanilla-server parity harnesses below could not run here (UnsupportedClassVersionError, class file 69 vs 61, and javac: release version 25 not supported) — they fail on unmodified main the same way, and CI's run-parity on this head decides.


**pr_ready** (`tools/pr_ready.py` on cachy-josh-pc, against origin/main at 9b12c8919, 7 min 54 s)

| Check | Result |
| --- | --- |
| Scope | ✅ 1 files, +42 −13 |
| Cargo.lock | ✅ unchanged |
| Public tree | ✅ |
| Python tests | ✅ 408 passed (24 s) |
| rustfmt | ✅ (4 s) |
| clippy | ✅ (40 s) |
| tests: horizon-client | ✅ 1291 passed (2 min 5 s) |
| doc tests | ✅ 0 passed (33 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 | ❌ 11 affected, 4 passed, failed: arrow, forced_end, online_mode, section_mesh, server_world_gen, user_cache (4 min 3 s) |
| Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) |

🔄 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/3498 **Author:** [@JustKarkat](https://github.com/JustKarkat) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/mob-drop-scatter` --- ### 📝 Commits (2) - [`d372e9e`](https://github.com/horizon-rust/horizon/commit/d372e9ece90ee9df3f355ce2b183f1d369fc672d) Mob-origin item drops get the ItemEntity constructor's random motion - [`16090d3`](https://github.com/horizon-rust/horizon/commit/16090d3d4a2331d7c4d394294e27fa8bcd5405f1) Drop motion from the ItemEntity's own random, not the level's ### 📊 Changes **1 file changed** (+19 additions, -12 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/creatures.rs` (+19 -12) </details> ### 📄 Description > 🤖 Opened by JustKarkat's AI agent (ZCode), working the [#3144](https://github.com/horizon-rust/horizon/issues/3144) card on Kira. Fixes #3144. A mob's item drops all spawned with the fixed motion `[0.0, 0.2, 0.0]`, so every drop from one mob landed stacked at the same exact point. Vanilla builds each drop as its own 5-arg `ItemEntity(level, x, y, z, stack)`, whose constructor throws it with a random horizontal push (±0.1 per axis, 0.2 up) — that is the scatter the report is missing. Three mob-origin sites had the fixed motion: - death loot (`drop_death_loot`) — the reported case, - gift-table loot (`drop_gift_loot`, e.g. a cat's or fox's gift), - `MobEvent::DropItem` (`spawnAtLocation` drops: the fox picking berries, the panda dropping held food when disturbed, the goat losing a horn). `MobEvent::DropGift` and player-death inventory drops already had the random motion, block drops (`popResource`) scatter via `spill::pop_position`, and XP orb spawn already carries the orb constructor's own random motion, so those are untouched. Inventory-give overflow paths (a bucketed fish's leftovers, a mob-interaction give) and the sheared-equipment drop use the different vanilla paths they cite and are left alone. The change is one file, +42 −13. Every death drop path is unchanged besides the motion fed to `spawn_item`. The local `java`/`javac` is Java 17, so the six vanilla-server parity harnesses below could not run here (`UnsupportedClassVersionError`, class file 69 vs 61, and `javac: release version 25 not supported`) — they fail on unmodified `main` the same way, and CI's `run-parity` on this head decides. ```markdown **pr_ready** (`tools/pr_ready.py` on cachy-josh-pc, against origin/main at 9b12c8919, 7 min 54 s) | Check | Result | | --- | --- | | Scope | ✅ 1 files, +42 −13 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 408 passed (24 s) | | rustfmt | ✅ (4 s) | | clippy | ✅ (40 s) | | tests: horizon-client | ✅ 1291 passed (2 min 5 s) | | doc tests | ✅ 0 passed (33 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 | ❌ 11 affected, 4 passed, failed: arrow, forced_end, online_mode, section_mesh, server_world_gen, user_cache (4 min 3 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:09:42 +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#5026
No description provided.