AFK protector
AFK Protector provides you with complete safety and protection while you are AFK. If there are zombies, creepers, phantoms, or other hostile mobs nearby while you are AFK, they ...
Screenshots

Description
Disclaimer: the image was created by AI
How AFK Protection Works
AFK Protection keeps you safe while you are away from your keyboard. When you enter AFK mode, the protection system prevents hostile mobs from killing you.
Zombies, creepers, phantoms, skeletons, and other hostile mobs will not be able to deal fatal damage to you while AFK. This allows you to leave your character unattended without worrying about being killed by nearby monsters.
Once you stop being AFK, the protection is automatically disabled and normal gameplay resumes.
Changelog
Removed unused imports
Optimized AFK tracking
Simplified event handling