Don't hit me!
This mod solves the problem with two types of kicks that often occur when using modifications:
When installed on the server, it prevents kicks with the message "Attempting to attack an invalid entity". The mod blocks such disconnections and additionally outputs information about the attacked entity to the log to simplify debugging.
On the client side, it eliminates the error "Cannot cast xxx to SnifferEntity". In this case, the mod redirects execution to the correct processing logic.
It's important to note that such problems usually don't occur in the vanilla version of the game, so this mod will be especially useful when using modpacks.
Recommendations for developers
Mod developers are recommended to avoid creating interactive entities of items, projectiles, and experience orbs. They should also exclude the use of entity status 63 in their projects.