This is relatively simple, it checks if the player is eating/drinking/using a shield when it tries to attack. If they are, cancel the attack.
Could reference Meteor's source for an idea of how to write it.
[source link](meteor-client/src/main/java/meteordevelopment/meteorclient/systems/modules/combat/KillAura.java at master ยท MeteorDevelopment/meteor-client)