@Mixin(EntityPlayerSP.class) public abstract class MixinEntityPlayerSP @Inject(method = "sendUseEntity", at = @At("HEAD")) private void onSendAttackPacket(Entity entity, int action, float x, float y, float z, CallbackInfo ci) if (action == 0) // 0 = ATTACK if (entity != null) // Trigger hit visual client-side entity.performHurtAnimation(); // Play hurt sound locally entity.worldObj.playSound(entity.posX, entity.posY, entity.posZ, entity.getHurtSound(), entity.getSoundCategory(), 1.0f, 1.0f, false);
Analysis and Implementation of the Hit Delay Fix for Minecraft 1.8.9 hit delay fix 1.8.9
Or simpler: allow double trigger – it’s barely noticeable and does not break mechanics. Most PvP clients accept the duplicate. @Mixin(EntityPlayerSP
| Test Case | Vanilla 1.8.9 | With Hit Delay Fix | |-----------|---------------|--------------------| | Ping = 0 ms | Instant feedback | Instant feedback | | Ping = 100 ms | 100 ms delay after click | Instant feedback | | Ping = 200 ms | 200 ms delay | Instant feedback | | Knockback sync | Normal | Normal | | Server damage rollback | Normal | Normal (client health correct) | | Anti-cheat flags (e.g., AAC, Watchdog) | None | None observed | hit delay fix 1.8.9