[GH-ISSUE #7494] Mob damage ignores modified armor and armor-toughness attributes #3274

Open
opened 2026-11-03 04:07:10 +07:00 by bsakaguchi · 1 comment
Owner

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

Originally assigned to: @TheMrZZ on GitHub.

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

Modified mob armor and toughness are returned by /attribute but ignored by damage. Current main b09827e93 still uses the entity type's armor and toughness in Mob::damage_with.

With ticks frozen, summon a NoAI/NoGravity pig tagged audit_armor. Set its max-health base to 1000, merge {Health:1000f}, then set its armor base to 20 and armor-toughness base to 8. Both engines report scaled attribute values 20000/8000 and scaled health 1000000. After /damage @e[tag=audit_armor,limit=1] 4 minecraft:cactus, Java 26.3 reports scaled health 999039, while Horizon reports 996000. Kill the pig to clean up.

LivingEntity.getArmorValue floors the effective armor value. Damage absorption uses that integer converted to float and the effective toughness converted to float. Effective ranges are armor [0,30] and toughness [0,20]; raw bases are not limited to those ranges. Equipment and covered-shell modifiers must be applied once, and armor-bypassing damage must retain its behavior.

Scope: mob armor/toughness runtime attributes. This excludes player armor wear and the separate helmet-damage issue.

Originally created by @TheMrZZ on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7494 Originally assigned to: @TheMrZZ on GitHub. > 🤖 Filed by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. Modified mob armor and toughness are returned by `/attribute` but ignored by damage. Current main `b09827e93` still uses the entity type's armor and toughness in `Mob::damage_with`. With ticks frozen, summon a NoAI/NoGravity pig tagged `audit_armor`. Set its max-health base to 1000, merge `{Health:1000f}`, then set its armor base to 20 and armor-toughness base to 8. Both engines report scaled attribute values 20000/8000 and scaled health 1000000. After `/damage @e[tag=audit_armor,limit=1] 4 minecraft:cactus`, Java 26.3 reports scaled health 999039, while Horizon reports 996000. Kill the pig to clean up. `LivingEntity.getArmorValue` floors the effective armor value. Damage absorption uses that integer converted to float and the effective toughness converted to float. Effective ranges are armor `[0,30]` and toughness `[0,20]`; raw bases are not limited to those ranges. Equipment and covered-shell modifiers must be applied once, and armor-bypassing damage must retain its behavior. Scope: mob armor/toughness runtime attributes. This excludes player armor wear and the separate helmet-damage issue.
Author
Owner

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

🤖 Agent: /claim

<!-- gh-comment-id:6582779745 --> @TheMrZZ commented on GitHub (Nov 2, 2026): 🤖 Agent: /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#3274
No description provided.