[PR #2950] [MERGED] Trim on trial chamber armour from loot set_components #4704

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

📋 Pull Request Information

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

Base: main ← Head: fix/loot-set-components-trim


📝 Commits (2)

  • 511f2c4 Apply loot set_components so trial armour keeps its trim
  • 1a8d0ef Make unknown loot conditions and number providers agree

📊 Changes

10 files changed (+96 additions, -13 deletions)

View changed files

📝 crates/horizon-client/examples/probe/entity_death_loot_fixture.rs (+1 -0)
📝 crates/horizon-client/src/entity_nbt.rs (+6 -3)
📝 crates/horizon-client/src/game/creatures.rs (+4 -0)
📝 crates/horizon-client/src/mobs/drops.rs (+5 -0)
📝 crates/horizon-client/src/mobs/finalize.rs (+13 -2)
📝 crates/horizon-client/src/mobs/gear.rs (+17 -3)
📝 crates/horizon-client/src/structure_blocks.rs (+5 -0)
📝 crates/horizon-items/src/item_data.rs (+18 -0)
📝 crates/horizon-items/src/items.rs (+11 -4)
📝 crates/horizon-world/src/loot.rs (+16 -1)

📄 Description

What and why

  • Trial chamber equipment tables give chainmail and iron armour a copper trim (bolt or flow) with minecraft:set_components. Horizon ignored that function, so the armour came out untrimmed and mobs dropped it untrimmed.
  • set_components is now applied to loot stacks. The trim stays on the mob's worn armour, is saved with the mob, and goes onto its drops. Trim and custom name are read into their typed fields; other components are kept as saved.
  • Unknown loot conditions and number providers now behave the same in both loot engines: an unknown condition fails and an unknown number provider gives 0. The block engine used to pass conditions and give 1. No vanilla table uses an unknown type, so this only affects data packs.
  • Not done: the trim is not drawn on mob armour yet (mob armour has no trim layer), and location_check with a block predicate in the block engine is still taken as true, because that engine has no world access at the offset.

Vanilla reference

  • SetComponentsFunction.java:31 (applyComponentsAndValidate)
  • data/minecraft/loot_table/equipment/trial_chamber.json (the only table that uses set_components)
  • LocationCheck.java:35 (test, the offset block predicate that is not implemented here)

Self-check

clippy and fmt pass for horizon-client, horizon-world and horizon-items. Not run in game.


🔄 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/2950 **Author:** [@kacpherek](https://github.com/kacpherek) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/loot-set-components-trim` --- ### 📝 Commits (2) - [`511f2c4`](https://github.com/horizon-rust/horizon/commit/511f2c42d8a66c75a3393e8841a1bb521239b88e) Apply loot set_components so trial armour keeps its trim - [`1a8d0ef`](https://github.com/horizon-rust/horizon/commit/1a8d0ef420297dc93a90d8dddd21502fcd1cf402) Make unknown loot conditions and number providers agree ### 📊 Changes **10 files changed** (+96 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/examples/probe/entity_death_loot_fixture.rs` (+1 -0) 📝 `crates/horizon-client/src/entity_nbt.rs` (+6 -3) 📝 `crates/horizon-client/src/game/creatures.rs` (+4 -0) 📝 `crates/horizon-client/src/mobs/drops.rs` (+5 -0) 📝 `crates/horizon-client/src/mobs/finalize.rs` (+13 -2) 📝 `crates/horizon-client/src/mobs/gear.rs` (+17 -3) 📝 `crates/horizon-client/src/structure_blocks.rs` (+5 -0) 📝 `crates/horizon-items/src/item_data.rs` (+18 -0) 📝 `crates/horizon-items/src/items.rs` (+11 -4) 📝 `crates/horizon-world/src/loot.rs` (+16 -1) </details> ### 📄 Description ## What and why - Trial chamber equipment tables give chainmail and iron armour a copper trim (bolt or flow) with `minecraft:set_components`. Horizon ignored that function, so the armour came out untrimmed and mobs dropped it untrimmed. - `set_components` is now applied to loot stacks. The trim stays on the mob's worn armour, is saved with the mob, and goes onto its drops. Trim and custom name are read into their typed fields; other components are kept as saved. - Unknown loot conditions and number providers now behave the same in both loot engines: an unknown condition fails and an unknown number provider gives 0. The block engine used to pass conditions and give 1. No vanilla table uses an unknown type, so this only affects data packs. - Not done: the trim is not drawn on mob armour yet (mob armour has no trim layer), and `location_check` with a block predicate in the block engine is still taken as true, because that engine has no world access at the offset. ## Vanilla reference - SetComponentsFunction.java:31 (`applyComponentsAndValidate`) - data/minecraft/loot_table/equipment/trial_chamber.json (the only table that uses set_components) - LocationCheck.java:35 (`test`, the offset block predicate that is not implemented here) ## Self-check clippy and fmt pass for horizon-client, horizon-world and horizon-items. Not run in game. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:07:19 +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#4704
No description provided.