[GH-ISSUE #4118] /attribute ignores the main hand's modifiers (diamond sword: attack_damage 1.0, vanilla 8.0) #1201

Closed
opened 2026-11-02 15:45:02 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @ludovic111 on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4118

🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself.

What: with a weapon in the main hand, /attribute @s minecraft:attack_damage get gives 1.0 (the player's base). attack_speed gives 4.0 and entity_interaction_range 3.0.

Vanilla 26.3: the main hand's attribute_modifiers apply as soon as the item is held (LivingEntity.collectEquipmentChanges, each tick). A diamond_sword gives attack damage 8.0 and attack speed 1.6.

Repro (main at 0e15c274d + the #3740–#3745 stack, default server thread, scratch home):

horizon-ctl launch --world T --creative --offscreen --wait --resources .local/horizon-client/26.3
horizon-ctl command 'gamemode survival'
horizon-ctl command 'item replace entity @s weapon.mainhand with minecraft:diamond_sword'
horizon-ctl wait 10
horizon-ctl command 'attribute @s minecraft:attack_damage get'   # 1.0, vanilla 8.0

Armour does apply: a full modded chorundum set reads armour 24, toughness 16, as vanilla would. So it is the hand slots, or /attribute's view of them. I haven't checked whether melee damage itself uses the sword (it may compute from the item directly), so this may be /attribute only.

Found while proving #3740.

Originally created by @ludovic111 on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4118 > 🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself. **What:** with a weapon in the main hand, `/attribute @s minecraft:attack_damage get` gives 1.0 (the player's base). `attack_speed` gives 4.0 and `entity_interaction_range` 3.0. **Vanilla 26.3:** the main hand's `attribute_modifiers` apply as soon as the item is held (`LivingEntity.collectEquipmentChanges`, each tick). A `diamond_sword` gives attack damage 8.0 and attack speed 1.6. **Repro** (main at 0e15c274d + the #3740–#3745 stack, default server thread, scratch home): ``` horizon-ctl launch --world T --creative --offscreen --wait --resources .local/horizon-client/26.3 horizon-ctl command 'gamemode survival' horizon-ctl command 'item replace entity @s weapon.mainhand with minecraft:diamond_sword' horizon-ctl wait 10 horizon-ctl command 'attribute @s minecraft:attack_damage get' # 1.0, vanilla 8.0 ``` Armour does apply: a full modded chorundum set reads armour 24, toughness 16, as vanilla would. So it is the hand slots, or `/attribute`'s view of them. I haven't checked whether melee damage itself uses the sword (it may compute from the item directly), so this may be `/attribute` only. Found while proving #3740.
Author
Owner

@DUzzL commented on GitHub (Oct 30, 2026):

C:/Program Files/Git/claim

<!-- gh-comment-id:6512440931 --> @DUzzL commented on GitHub (Oct 30, 2026): C:/Program Files/Git/claim
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#1201
No description provided.