[PR #2392] [MERGED] Apply the set_name loot function to generated items #4272

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

📋 Pull Request Information

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

Base: main ← Head: fix/loot-set-name


📝 Commits (1)

  • dc36089 Apply the set_name loot function to generated items

📊 Changes

6 files changed (+34 additions, -1 deletions)

View changed files

📝 crates/horizon-client/examples/probe/entity_death_loot_fixture.rs (+1 -0)
📝 crates/horizon-client/src/game/creatures.rs (+4 -0)
📝 crates/horizon-client/src/item_data.rs (+10 -0)
📝 crates/horizon-client/src/mobs/drops.rs (+1 -0)
📝 crates/horizon-client/src/structure_blocks.rs (+5 -0)
📝 crates/horizon-world/src/loot.rs (+13 -1)

📄 Description

What and why

Maps from abandoned camp chests had no name. The loot function minecraft:set_name was ignored, so the 8 camp maps (filled_map.bamboo_camp_map and the others, target item_name) came out as plain "Map".

set_name now records the component and the stack gets it when the loot becomes an item: item_name is stored as the text component as loaded (so it saves and reaches clients unchanged), custom_name as plain text like the rest of Horizon. This applies to chest/vault/pot/trial spawner loot and to entity drops.

Selectors and scores in the entity field are not resolved; no vanilla table uses entity.

Vanilla reference

  • SetNameFunction.run and SetNameFunction.Target.component (custom_name by default, item_name for the camp tables).

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/2392 **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/loot-set-name` --- ### 📝 Commits (1) - [`dc36089`](https://github.com/horizon-rust/horizon/commit/dc36089156d9af32cd00be9dc4f966faea90cd3a) Apply the set_name loot function to generated items ### 📊 Changes **6 files changed** (+34 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/entity_death_loot_fixture.rs` (+1 -0) 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -0) 📝 `crates/horizon-client/src/item_data.rs` (+10 -0) 📝 `crates/horizon-client/src/mobs/drops.rs` (+1 -0) 📝 `crates/horizon-client/src/structure_blocks.rs` (+5 -0) 📝 `crates/horizon-world/src/loot.rs` (+13 -1) </details> ### 📄 Description ## What and why Maps from abandoned camp chests had no name. The loot function `minecraft:set_name` was ignored, so the 8 camp maps (`filled_map.bamboo_camp_map` and the others, target `item_name`) came out as plain "Map". `set_name` now records the component and the stack gets it when the loot becomes an item: `item_name` is stored as the text component as loaded (so it saves and reaches clients unchanged), `custom_name` as plain text like the rest of Horizon. This applies to chest/vault/pot/trial spawner loot and to entity drops. Selectors and scores in the `entity` field are not resolved; no vanilla table uses `entity`. ## Vanilla reference - `SetNameFunction.run` and `SetNameFunction.Target.component` (`custom_name` by default, `item_name` for the camp tables). ## 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:57 +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#4272
No description provided.