[GH-ISSUE #6777] Data packs: a block a player breaks ignores the world's loot table when the table has a random sequence #2215

Closed
opened 2026-11-02 15:53:04 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @ErikKalikas on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6777

Originally assigned to: @ErikKalikas on GitHub.

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

When a player breaks a block, a world data pack that replaces the block's loot table is ignored if the table has a random_sequence, and every vanilla block table has one. Breaking stone with a pack that makes blocks/stone drop diamonds still drops cobblestone. A table without random_sequence is read from the pack as it should be.

Where, on main at e12185820: Game::block_loot_at (crates/horizon-client/src/game.rs:3782) takes the sequence from the world's tables (world_items!(self).block_loot_sequence), but then rolls self.res.items().block_drops_by_player(…): the game's own tables, without the world's packs. The branch without a sequence rolls world_items!(self), as /loot (commands/terrain_cmds.rs) and the dispenser (dispenser.rs) do in both branches.

Vanilla: BlockBehaviour.getDrops takes the table from level.getServer().reloadableRegistries().getLootTable(…), the tables with the world's data packs applied, and draws from the table's random sequence when it has one.

How to test: a world data pack with data/minecraft/loot_table/blocks/stone.json (with "random_sequence": "minecraft:blocks/stone") that drops something else; reload, then break stone in survival on the server thread and on a dedicated server.

Originally created by @ErikKalikas on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6777 Originally assigned to: @ErikKalikas on GitHub. > 🤖 Filed by ErikKalikas's AI agent (Claude Code, Claude Opus 5.5), not by ErikKalikas personally. When a player breaks a block, a world data pack that replaces the block's loot table is ignored if the table has a `random_sequence`, and every vanilla block table has one. Breaking stone with a pack that makes `blocks/stone` drop diamonds still drops cobblestone. A table without `random_sequence` is read from the pack as it should be. **Where, on main at `e12185820`:** `Game::block_loot_at` (`crates/horizon-client/src/game.rs:3782`) takes the sequence from the world's tables (`world_items!(self).block_loot_sequence`), but then rolls `self.res.items().block_drops_by_player(…)`: the game's own tables, without the world's packs. The branch without a sequence rolls `world_items!(self)`, as `/loot` (`commands/terrain_cmds.rs`) and the dispenser (`dispenser.rs`) do in both branches. **Vanilla:** `BlockBehaviour.getDrops` takes the table from `level.getServer().reloadableRegistries().getLootTable(…)`, the tables with the world's data packs applied, and draws from the table's random sequence when it has one. **How to test:** a world data pack with `data/minecraft/loot_table/blocks/stone.json` (with `"random_sequence": "minecraft:blocks/stone"`) that drops something else; `reload`, then break stone in survival on the server thread and on a dedicated server.
Author
Owner

@ErikKalikas commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6569128346 --> @ErikKalikas commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Author
Owner

@ErikKalikas commented on GitHub (Nov 2, 2026):

🤖 Agent: A correction to the description: the dispenser is not right in both branches. Game::sequence_loot (game/dispenser.rs) rolls self.res.items() when the table has no random_sequence, so a world data pack's harvest/beehive without one is ignored when shears (from a dispenser or a player) harvest a full beehive; brushing an armadillo and the shearing tables go through the same function. The PR fixes both places.

<!-- gh-comment-id:6569271912 --> @ErikKalikas commented on GitHub (Nov 2, 2026): 🤖 Agent: A correction to the description: the dispenser is not right in both branches. `Game::sequence_loot` (`game/dispenser.rs`) rolls `self.res.items()` when the table has no `random_sequence`, so a world data pack's `harvest/beehive` without one is ignored when shears (from a dispenser or a player) harvest a full beehive; brushing an armadillo and the shearing tables go through the same function. The PR fixes both places.
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#2215
No description provided.