[GH-ISSUE #7543] /loot ignores set_damage modifiers #3287

Open
opened 2026-11-03 04:07:17 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @TheMrZZ on GitHub.

🤖 Filed by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

/loot ignores minecraft:set_damage in the items loot engine. On Java 26.3, these commands put an iron sword with damage 125 in the chest; Horizon leaves it pristine:

setblock 2 220 2 chest
loot replace block 2 220 2 container.0 loot {pools:[{rolls:1,entries:[{type:"minecraft:item",name:"minecraft:iron_sword",modifier:{type:"minecraft:set_damage",damage:0.5}}]}]}
data get block 2 220 2 Items

The 26.3 field is modifier. The separate world loot engine already handles this function, but /loot uses the items engine. A random damage provider also goes unsampled, shifting the named random sequence. The fix should preserve damageability checks, float arithmetic, add/clamp behavior and random consumption. Nested table entries and tracker counts in #7506 are separate work.

Originally created by @TheMrZZ on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7543 Originally assigned to: @TheMrZZ on GitHub. > 🤖 Filed by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. `/loot` ignores `minecraft:set_damage` in the items loot engine. On Java 26.3, these commands put an iron sword with damage 125 in the chest; Horizon leaves it pristine: ```mcfunction setblock 2 220 2 chest loot replace block 2 220 2 container.0 loot {pools:[{rolls:1,entries:[{type:"minecraft:item",name:"minecraft:iron_sword",modifier:{type:"minecraft:set_damage",damage:0.5}}]}]} data get block 2 220 2 Items ``` The 26.3 field is `modifier`. The separate world loot engine already handles this function, but `/loot` uses the items engine. A random damage provider also goes unsampled, shifting the named random sequence. The fix should preserve damageability checks, float arithmetic, add/clamp behavior and random consumption. Nested table entries and tracker counts in #7506 are separate work.
Author
Owner

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

🤖 Agent: /claim

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

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

🤖 Agent: Runtime checks reproduced six differences on unchanged main. Implementing set_damage alone fixed the constant/additive cases, but the uniform case exposed a coupled command-routing gap: inline tables ignored their random_sequence and always used the world random source. The fix will also select the inline table’s named stream, with an explicit table-without-sequence control. Nested table expansion and tracker counts remain in #7506.

<!-- gh-comment-id:6584119945 --> @TheMrZZ commented on GitHub (Nov 2, 2026): 🤖 Agent: Runtime checks reproduced six differences on unchanged main. Implementing `set_damage` alone fixed the constant/additive cases, but the uniform case exposed a coupled command-routing gap: inline tables ignored their `random_sequence` and always used the world random source. The fix will also select the inline table’s named stream, with an explicit table-without-sequence control. Nested table expansion and tracker counts remain in #7506.
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#3287
No description provided.