Move hurt resistant time handling from LivingHurtEvent to LivingAttackEvent

- Remove legacy attack speed handling from ServerEventsHandler.LivingHurtEvent
  (was setting hurtResistantTime AFTER immunity check, too late)
- Add proper handling in ScriptPlayerEventHandler.LivingAttackEvent
  (sets hurtResistantTime=0 BEFORE immunity check for fast weapons)
- For weapons with attackSpeed < 20, bypass invincibility frames to allow
  rapid attacks to land
This commit is contained in:
Claude committed 2025-12-31 00:45:26 +00:00
1 parent ce8e38b6bd
commit 185a8bc917
2 files changed
+4 -10

No files matched your search

@@ -554,7 +554,10 @@ public class ScriptPlayerEventHandler {
if (itemStack instanceof ScriptCustomizableItem) {
ScriptCustomizableItem sci = (ScriptCustomizableItem) itemStack;
int attackSpeed = sci.getAttackSpeed();
// TODO: Check Hurt Resistant Time.
if (attackSpeed < 20) {
event.entityLiving.hurtResistantTime = 0;
event.entityLiving.hurtTime = attackSpeed;
}
}
}