mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-16 13:04:46 +00:00
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:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user