[PR #2390] [MERGED] Broken heads keep their skin and silk-touched hives keep their bees and honey #4269

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

📋 Pull Request Information

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

Base: main ← Head: fix/block-loot-copy-components


📝 Commits (1)

  • 08c9598 Broken heads keep their skin and silk-touched hives keep their bees and honey

📊 Changes

5 files changed (+115 additions, -3 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -0)
📝 crates/horizon-client/src/game/block_items.rs (+42 -2)
📝 crates/horizon-client/src/game/dispenser.rs (+1 -0)
📝 crates/horizon-client/src/game/spill.rs (+45 -1)
📝 crates/horizon-client/src/items.rs (+26 -0)

📄 Description

What and why

A broken block's loot table copies data from the block into the dropped item, and Horizon ignored most of it:

  • A player head dropped without its skin (the profile), note block sound and name, so it came back as a plain Steve head.
  • A beehive or bee nest mined with silk touch dropped empty: the bees inside and the honey level were lost.
  • A copper golem statue dropped without its pose.

Now the head's profile, note block sound and custom name (other heads: the custom name), and a hive's bees are copied from the block entity into the dropped item (player breaking, explosions and block-removal drops all share this path). The copy_state loot function is evaluated: it stores the listed block properties (honey_level, copper_golem_pose) in the item's minecraft:block_state component. The item model already reads that component, so a dropped statue shows its pose.

Placing such an item now applies its minecraft:block_state to the new block (by a player or a dispenser), so the honey level and pose come back. This also fixes a hive or statue picked in creative with Ctrl, which already carried the component but lost it on placing.

Vanilla reference

  • Loot tables blocks/player_head, creeper_head etc., beehive, bee_nest, *copper_golem_statue: copy_components (source: block_entity) and copy_state.
  • CopyBlockState.run: sets BLOCK_STATE from the listed properties the block has.
  • BlockEntity.collectComponents through the existing block_entity_item::pick.
  • BlockItem.updateBlockStateFromTag: the item's block_state properties are applied to the placement state.

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/2390 **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/block-loot-copy-components` --- ### 📝 Commits (1) - [`08c9598`](https://github.com/horizon-rust/horizon/commit/08c959807d291ef94bf9baf58fb4b9e3179c551d) Broken heads keep their skin and silk-touched hives keep their bees and honey ### 📊 Changes **5 files changed** (+115 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -0) 📝 `crates/horizon-client/src/game/block_items.rs` (+42 -2) 📝 `crates/horizon-client/src/game/dispenser.rs` (+1 -0) 📝 `crates/horizon-client/src/game/spill.rs` (+45 -1) 📝 `crates/horizon-client/src/items.rs` (+26 -0) </details> ### 📄 Description ## What and why A broken block's loot table copies data from the block into the dropped item, and Horizon ignored most of it: - A player head dropped without its skin (the `profile`), note block sound and name, so it came back as a plain Steve head. - A beehive or bee nest mined with silk touch dropped empty: the bees inside and the honey level were lost. - A copper golem statue dropped without its pose. Now the head's profile, note block sound and custom name (other heads: the custom name), and a hive's bees are copied from the block entity into the dropped item (player breaking, explosions and block-removal drops all share this path). The `copy_state` loot function is evaluated: it stores the listed block properties (`honey_level`, `copper_golem_pose`) in the item's `minecraft:block_state` component. The item model already reads that component, so a dropped statue shows its pose. Placing such an item now applies its `minecraft:block_state` to the new block (by a player or a dispenser), so the honey level and pose come back. This also fixes a hive or statue picked in creative with Ctrl, which already carried the component but lost it on placing. ## Vanilla reference - Loot tables `blocks/player_head`, `creeper_head` etc., `beehive`, `bee_nest`, `*copper_golem_statue`: `copy_components` (`source: block_entity`) and `copy_state`. - `CopyBlockState.run`: sets `BLOCK_STATE` from the listed properties the block has. - `BlockEntity.collectComponents` through the existing `block_entity_item::pick`. - `BlockItem.updateBlockStateFromTag`: the item's `block_state` properties are applied to the placement state. ## 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:56 +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#4269
No description provided.