[GH-ISSUE #7424] /loot … mine says a content mod's block has no loot table #3235

Closed
opened 2026-11-03 04:06:54 +07:00 by bsakaguchi · 5 comments
Owner

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

Originally assigned to: @testatanucleare13-create on GitHub.

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

What happens

/loot <target> mine <pos> [tool] on a content mod's block fails, though breaking the same block rolls its
table:

/loot spawn ~ ~2 ~ mine <x> <y> <z> minecraft:netherite_pickaxe
Block loot_repro:glowing_amethyst has no loot table

On a vanilla block (minecraft:barrel) the same command drops 1 [Barrel] from loot table minecraft:blocks/barrel,
and in survival a netherite pickaxe breaking loot_repro:glowing_amethyst drops it.

Expected

As vanilla: LootCommand's mine rolls the broken block's own loot table (BlockBehaviour.getLootTable, <ns>:blocks/<name>),
whatever its namespace.

Why

The mine arm in crates/horizon-client/src/game/commands/terrain_cmds.rs (line 577 on main at 0cf1b3d) builds
the id in the minecraft namespace:

let table = format!("minecraft:blocks/{}", name.trim_start_matches("minecraft:"));

so loot_repro:glowing_amethyst looks for minecraft:blocks/loot_repro:glowing_amethyst. Breaking a block goes
through Items::block_loot_table(registry, state) (horizon-items/src/items.rs), which keeps the namespace and maps
wall variants to the standing block's table; using it here would make the two agree.

Related: #7408 lets /loot … loot <id> name a mod's tables; it doesn't change mine.

Reproduce

  1. cargo horizon-mod new loot-repro && cd loot-repro && cargo horizon-mod build; put
    target/horizon-mod/loot_repro.hmod in the game folder's horizon-mods/ and turn it on.
  2. In a creative world: /setblock ~2 ~ ~ loot_repro:glowing_amethyst, then
    /loot spawn ~ ~2 ~ mine ~2 ~ ~ minecraft:netherite_pickaxe → "has no loot table".
  3. Same with minecraft:barrel in its place → drops a barrel.

Seen on Nightly 2026-11-01 (c9d474d) and on a build of 0f0fa62, Linux; the code is unchanged on main (0cf1b3d).

Originally created by @Dawnforger on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7424 Originally assigned to: @testatanucleare13-create on GitHub. > 🤖 Filed by Dawnforger's AI agent (Claude Code, Claude Opus 5.5), not by Dawnforger personally. ### What happens `/loot <target> mine <pos> [tool]` on a content mod's block fails, though breaking the same block rolls its table: ``` /loot spawn ~ ~2 ~ mine <x> <y> <z> minecraft:netherite_pickaxe Block loot_repro:glowing_amethyst has no loot table ``` On a vanilla block (`minecraft:barrel`) the same command drops `1 [Barrel] from loot table minecraft:blocks/barrel`, and in survival a netherite pickaxe breaking `loot_repro:glowing_amethyst` drops it. ### Expected As vanilla: `LootCommand`'s `mine` rolls the broken block's own loot table (`BlockBehaviour.getLootTable`, `<ns>:blocks/<name>`), whatever its namespace. ### Why The `mine` arm in `crates/horizon-client/src/game/commands/terrain_cmds.rs` (line 577 on `main` at `0cf1b3d`) builds the id in the `minecraft` namespace: ```rust let table = format!("minecraft:blocks/{}", name.trim_start_matches("minecraft:")); ``` so `loot_repro:glowing_amethyst` looks for `minecraft:blocks/loot_repro:glowing_amethyst`. Breaking a block goes through `Items::block_loot_table(registry, state)` (`horizon-items/src/items.rs`), which keeps the namespace and maps wall variants to the standing block's table; using it here would make the two agree. Related: #7408 lets `/loot … loot <id>` name a mod's tables; it doesn't change `mine`. ### Reproduce 1. `cargo horizon-mod new loot-repro && cd loot-repro && cargo horizon-mod build`; put `target/horizon-mod/loot_repro.hmod` in the game folder's `horizon-mods/` and turn it on. 2. In a creative world: `/setblock ~2 ~ ~ loot_repro:glowing_amethyst`, then `/loot spawn ~ ~2 ~ mine ~2 ~ ~ minecraft:netherite_pickaxe` → "has no loot table". 3. Same with `minecraft:barrel` in its place → drops a barrel. Seen on Nightly 2026-11-01 (`c9d474d`) and on a build of `0f0fa62`, Linux; the code is unchanged on `main` (`0cf1b3d`).
Author
Owner

@testatanucleare13-create commented on GitHub (Nov 2, 2026):

/claim

<!-- gh-comment-id:6581761691 --> @testatanucleare13-create commented on GitHub (Nov 2, 2026): /claim
Author
Owner

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

🤖 Agent: /claim

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

@github-actions[bot] commented on GitHub (Nov 2, 2026):

🤖 Claims: refused, @testatanucleare13-create already claimed this issue: pick another, or ask them here. (asked by @glitchsnake)

<!-- gh-comment-id:6581882377 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): 🤖 Claims: refused, @testatanucleare13-create already claimed this issue: pick another, or ask them here. (asked by @glitchsnake)
Author
Owner

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

🤖 Agent: /unclaim

<!-- gh-comment-id:6581886517 --> @glitchsnake commented on GitHub (Nov 2, 2026): 🤖 Agent: /unclaim
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

🤖 Claims: refused, You don't hold this issue. (asked by @glitchsnake)

<!-- gh-comment-id:6581908319 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): 🤖 Claims: refused, You don't hold this issue. (asked by @glitchsnake)
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#3235
No description provided.