[PR #6787] [MERGED] Data packs: a broken block and a sequence-less shear roll the world's loot tables #7095

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6787
Author: @ErikKalikas
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/block-loot-world-sequence


📝 Commits (1)

  • cc99f96 Data packs: a broken block and a sequence-less shear roll the world's loot tables

📊 Changes

2 files changed (+2 additions, -6 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+1 -2)
📝 crates/horizon-client/src/game/dispenser.rs (+1 -4)

📄 Description

🤖 Opened by ErikKalikas's AI agent (Claude Code, Claude Opus 5.5), not by ErikKalikas personally.

What and why

A world data pack's loot table was ignored on two paths, which rolled the game's own tables instead of the world's:

  • Game::block_loot_at (a player breaks a block): when the block's table has a random_sequence, and every vanilla block table has one. Breaking stone with a pack that makes blocks/stone drop diamonds still dropped cobblestone.
  • Game::sequence_loot (game/dispenser.rs): when the table has no random_sequence. Shears (a dispenser's or a player's) harvesting a full beehive, the shearing tables and brushing an armadillo go through it.

Both now roll world_items!(self), as the other branch of each function, /loot and drop_resources_now already did.

Fixes #6777

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

BlockBehaviour.getDrops and Block.dropFromLootTable (behind BeehiveBlock.dropHoneycomb → dropFromBlockInteractLootTable) both take the table from level.getServer().reloadableRegistries().getLootTable(key): the tables with the world's data packs applied, whether or not the table has a random sequence. No harness rolls a world data pack's table; checked in game below.

In-game check, a world data pack with blocks/stone → diamond (with "random_sequence": "minecraft:blocks/stone"), blocks/granite → emerald (no sequence, control), harvest/beehive → diamond (no sequence). A survival player breaks the blocks (horizon-ctl break); a dispenser with shears faces a beehive at honey_level=5.

main this PR (server thread) this PR (dedicated server)
player breaks stone cobblestone diamond diamond
player breaks granite emerald emerald emerald
dispenser shears the beehive honeycomb diamond diamond

main gives the same result on the server thread and on a dedicated server.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick --base upstream/main on kased-h610mkddr4, against upstream/main at e12185820, 3 min 37 s)

Check Result
Scope ✅ 2 files, +2 −6
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 602 passed (30 s)
rustfmt ✅ (6 s)
clippy ✅ (1 min 38 s)
tests: horizon-client ✅ 604 passed (1 min 14 s)
doc tests ✅ 0 passed (1 s)
content root tests ➖ content root untouched
mod API up to date ✅ (4 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ 294 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, blending, block_particles, boat_authority, boat_paddle_reset, boat_submerged, breaking_model, datafix, datapack_worldgen, decorated_region and 282 more
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code


🔄 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/6787 **Author:** [@ErikKalikas](https://github.com/ErikKalikas) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/block-loot-world-sequence` --- ### 📝 Commits (1) - [`cc99f96`](https://github.com/horizon-rust/horizon/commit/cc99f960338a85fe21120d7aced0107bf5a9fe88) Data packs: a broken block and a sequence-less shear roll the world's loot tables ### 📊 Changes **2 files changed** (+2 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+1 -2) 📝 `crates/horizon-client/src/game/dispenser.rs` (+1 -4) </details> ### 📄 Description > 🤖 Opened by ErikKalikas's AI agent (Claude Code, Claude Opus 5.5), not by ErikKalikas personally. ## What and why A world data pack's loot table was ignored on two paths, which rolled the game's own tables instead of the world's: - `Game::block_loot_at` (a player breaks a block): when the block's table has a `random_sequence`, and every vanilla block table has one. Breaking stone with a pack that makes `blocks/stone` drop diamonds still dropped cobblestone. - `Game::sequence_loot` (`game/dispenser.rs`): when the table has no `random_sequence`. Shears (a dispenser's or a player's) harvesting a full beehive, the shearing tables and brushing an armadillo go through it. Both now roll `world_items!(self)`, as the other branch of each function, `/loot` and `drop_resources_now` already did. Fixes #6777 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference `BlockBehaviour.getDrops` and `Block.dropFromLootTable` (behind `BeehiveBlock.dropHoneycomb` → `dropFromBlockInteractLootTable`) both take the table from `level.getServer().reloadableRegistries().getLootTable(key)`: the tables with the world's data packs applied, whether or not the table has a random sequence. No harness rolls a world data pack's table; checked in game below. **In-game check**, a world data pack with `blocks/stone` → diamond (with `"random_sequence": "minecraft:blocks/stone"`), `blocks/granite` → emerald (no sequence, control), `harvest/beehive` → diamond (no sequence). A survival player breaks the blocks (`horizon-ctl break`); a dispenser with shears faces a beehive at `honey_level=5`. | | main | this PR (server thread) | this PR (dedicated server) | |---|---|---|---| | player breaks stone | cobblestone | diamond | diamond | | player breaks granite | emerald | emerald | emerald | | dispenser shears the beehive | honeycomb | diamond | diamond | `main` gives the same result on the server thread and on a dedicated server. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick --base upstream/main` on kased-h610mkddr4, against upstream/main at e12185820, 3 min 37 s) | Check | Result | | --- | --- | | Scope | ✅ 2 files, +2 −6 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 602 passed (30 s) | | rustfmt | ✅ (6 s) | | clippy | ✅ (1 min 38 s) | | tests: horizon-client | ✅ 604 passed (1 min 14 s) | | doc tests | ✅ 0 passed (1 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (4 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ 294 affected, to run in CI (--quick): armor_stand_frost, arrow, arrow_wind_charge, blending, block_particles, boat_authority, boat_paddle_reset, boat_submerged, breaking_model, datafix, datapack_worldgen, decorated_region and 282 more | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:33: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#7095
No description provided.