Protect My Villager
by yfc
Protect My Villager stops players from hitting villagers by accident, using a client-side filter that cancels attack packets aimed at villager entities.
What it does
The mod hooks the attack methods in the client and checks the entity type before an attack is sent. When the target is a villager, the attack packet is cancelled before it leaves the game, so a stray click cannot injure or kill the villager. Other entity types can still be attacked as usual.
Because the filter works entirely on the client, it can be added to any Fabric world or server without server-side changes, and players can keep using it on servers that do not run the mod. Settings are exposed through Mod Menu, where a player can adjust the options and toggle the hand swing animation that plays when attacking villagers. An option also lets a sword-type item in hand bypass the cancellation, for players who need to strike a villager on purpose.
Fabric API is required. Mod Menu is optional and only adds the configuration screen. The environment is client-side only, and the mod is released under the Creative Commons Attribution 4.0 license, so it is not open source. Files exist for 12 game versions, 1.21 – 1.21.11, with 1.2.4 for 1.21.11 as the latest Fabric file.
Key features
Villager attack filter
Attack packets aimed at villagers are cancelled on the client before they are sent, so accidental hits do nothing.
Entity type filtering
The filter checks the target's entity type, so only villagers are protected and other mobs behave normally.
Mod Menu configuration
Options can be changed through the Mod Menu screen without editing files by hand.
Hand swing toggle
The hand swing animation that plays when attacking a villager can be turned off in the settings.
Sword bypass
Holding a sword-type item can bypass the cancellation, letting a player attack a villager deliberately.
Gallery
Compatibility
Latest build for each game version and loader.
1.21.x12 of 12 versions with builds
Only full game releases are shown. This mod publishes no snapshot builds.
Requirements
Dependencies declared by the latest file for each loader.
Required 1
Optional 1
Use cases
Who it’s for: Players who often click through crowded villager areas and want a safeguard against accidental attacks, mainly in survival worlds and on multiplayer servers that allow Fabric clients.
Questions
Does Protect My Villager need Fabric API?
Does the server need Protect My Villager installed?
Which game versions does Protect My Villager support?
In the catalog
Protect My Villager is one of 11,058 Mobs mods on ModsFinder, and one of 5,189 Mobs mods for Fabric. 19,862 mods support Minecraft 1.21.11.
More from yfc
Similar mods
Official listing
- Modrinth page
- modrinth.com/mod/protectmyvillager
- Owner
- yfc
- Published
- 2025-10-10
- Updated on Modrinth
- 2026-05-13
- Facts verified
- 2026-10-15
