Village Defenders

Transforms villagers into an organized defensive force that detects threats, raises alarms, protects the village, and coordinates with iron golems during dangerous attacks.
Back to Files

VillageDefendersMod.jar

File namedefensivemod-1.0.0.jar
Uploader
KnaifuKnaifu
Uploaded
Jul 20, 2026
Downloads
11
Size
244.8 KB
Mod Loaders
Fabric
File ID
8470780
Type
B
Beta
Supported game versions
  • 1.21.4

Curse Maven Snippet

Fabric

modImplementation "curse.maven:village-defenders-1611128:8470780"

Learn more about Curse Maven

What's new

 

Changelog

1.0.0 - 2026-07-20

Changes since the previous development build

- Fixed the settlement-state crash caused by an illegal transition from `FULL_DEFENCE` to `LOCAL_SKIRMISH`.
- Stabilized full defence and withdrawal so an overwhelmed settlement no longer rapidly oscillates between the two states.
- Added the missing villager attack-damage attribute that previously caused defender attacks to crash the server.
- Fixed melee pursuit after knockback, allowing defenders to resume chasing and repeatedly attack a confirmed aggressor.
- Cleared conflicting vanilla panic and avoidance memories while a villager is actively serving as a defender.
- Delayed the first attack after borrowing a weapon until Minecraft has applied the weapon's actual attribute modifiers.
- Fixed Netherite and other borrowed swords dealing incorrect or reduced damage.
- Prevented vanilla villager work and item-display tasks from deleting an active Armory Rack loan.
- Added recovery for legacy weapon loans that were erased from living villagers. The base item is restored to its Armory Rack when possible.
- Changed equipment assignment to use real, slot-aware reservations and a finite per-settlement equipment budget.
- Added borrowing for helmets, chestplates, leggings and boots for eligible frontline defenders.
- Added rate-limited diagnostics explaining why a villager was rejected from a defensive role, including missing weapons, armor or supplies.
- Changed hostile-player escalation so a player who attacks a villager still causes immediate full defence, but the resulting high threat score no longer automatically makes equipped defenders withdraw.
- Kept hostile-player targeting tied to the confirmed aggressor instead of treating every nearby player as hostile.
- Added expiry and deduplication for hostile-player danger memory.
- Filtered distant or vertically irrelevant ambient mobs unless they are actively targeting a villager or village golem, are close enough to matter, or were recently confirmed as attackers.
- Added raid-participant discovery beyond the normal nearby-hostile scan.
- Returned iron golems to vanilla targeting, anger, and movement when the mod has no active defensive assignment for them.
- Removed the global golem target interceptor that could interfere with normal golem behavior.
- Limited temporary defensive golem assignments by horizontal and vertical distance and added return-to-settlement handling when an assigned target becomes invalid.
- Consolidated overlapping settlement records and assigned each loaded villager and golem to one nearby settlement coordinator to reduce conflicting orders.
- Improved protector interception so active defenders can leave Guard Posts to engage confirmed threats within the settlement boundary.
- Reworked guardian-child emergency movement so an adult leads toward shelter and the child follows.
- Stabilized shelter and withdrawal destinations instead of recalculating a moving destination every scan.
- Added a five-second retry delay for an unchanged failed route and stopped restarting a route that navigation has already accepted.
- Added rate-limited navigation-failure logging for shelter, withdrawal, Guard Post and combat movement.
- Replaced detached defensive arms with poses applied to the vanilla villager arms, preventing duplicated or floating arm models.
- Added held main-hand and off-hand item rendering using Minecraft's third-person item transforms.
- Added restrained melee swing presentation, settlement state synchronization, the Defense Ledger screen, vanilla alarm cues and defensive state feedback.
- Added Guard Posts, Shelter Markers, Armory Racks, and Defense Ledgers, including their current recipes, models, loot tables, tags, and translations.
- Added optional, versioned integration points for Villager AI, Villager Identity and Villager Types while retaining standalone fallbacks.
- Expanded automated coverage for settlement transitions, equipment reservations, finite equipment allocation, legacy-loan recovery, repair safeguards, persistence and configuration reloads.

 

Confirmed in the latest live test

- Attacking a villager was detected and immediately placed the affected settlement into `FULL_DEFENCE`.
- An equipped Weaponsmith repeatedly pursued and killed the hostile player with a Netherite sword using the expected weapon damage.
- An equipped Armorer repeatedly attacked and killed the hostile player instead of landing one weakened hit and permanently fleeing.
- A village iron golem retained its normal response and also attacked the hostile player.
- Hostile-player memory remained active across player death, re-entry and teleportation during the tested incident.
- The settlement left its emergency state and eventually returned to `NORMAL` after the danger expired.
- Ambient-threat filtering ignored nearby mobs that did not meet the defensive relevance rules.
- Five missing legacy Netherite sword loans were detected and restored.
- The latest automated run completed with all 56 tests passing, and the clean test, datagen, and build tasks completed successfully.


Known issues and unverified areas

Armor, shields, and animations

- Villager armor currently looks awkward. Vanilla humanoid armor is being adapted to villager proportions, so helmets, chestplates, leggings and boots can appear oversized, misaligned, or clip through the villager head, body, profession clothing, or biome clothing.
- Chestplate arm pieces are hidden to avoid recreating the earlier floating-player-arm problem. This reduces the worst visual overlap, but the overall armor fit is still not polished.
- Shields do not yet sit naturally against the villager's crossed-arm model. Their placement and pose can look misaligned, float, or clip and still need a dedicated visual revision.
- Sword holding and attack swings work, but the pose remains restrained and can still look stiff or unlike the way a player holds a sword.
- Armor and shield presentation has not been checked across every profession, biome outfit, resource pack, camera angle, or multiplayer client.

 

Combat and raids

- Raid defense is not yet confirmed to work reliably in live gameplay. The code can discover raid participants, but the latest test session produced no raid-defense evidence. Treat raids as a known unresolved area rather than a verified feature.
- Repeated melee combat against an attacking player is confirmed; equivalent behavior against zombies, illagers and other hostile mobs still needs a complete live retest.
- Ranged defender behavior, ammunition consumption, protected-entity shot checks and Cleric support actions are implemented but have not been fully verified in the latest playtest.
- Creative-mode aggressor handling, multiple simultaneous hostile players, disconnected aggressors and aggressors crossing settlement boundaries still need broader testing.
- Golem behavior appeared normal in the latest test, but very distant or vertically separated targets, several simultaneous settlements, unreachable targets and full raid waves have not been exhaustively retested.

 

Villager movement and settlement behavior

- Defensive navigation can still fail on complex terrain, inside cramped houses, or when a destination is not actually reachable. The retry delay reduces repeated route spam, it does not make an invalid route valid.
- The latest session still recorded failed shelter, withdrawal, Guard Post and engagement routes. Civilians may therefore run in an unexpected direction, pause or fail to reach their intended safe location.
- A physical village can still be divided into nearby settlement records in edge cases. This may leave a villager unable to use equipment, shelters or posts owned by the neighboring record even though a player considers both areas one village.
- A settlement with no available defensive capacity can still escalate strongly in response to a relevant nearby hostile. Civilians may briefly shelter or withdraw even when the incident is small or disappears quickly.
- Calm-time child and guardian behavior still needs confirmation. Emergency guardian assignment, trusted-adult fallback, child shelter completion and cleanup after the emergency have not been exhaustively tested.
- Crowded villages, unusually shaped settlements, stacked villages, caves beneath villages and heavily modified navigation may produce behavior that has not yet been observed during testing.

 

Equipment and recovery

- Armor borrowing is implemented, but the full borrow, equip, fight, return and re-borrow cycle has not been verified for every eligible role and armor combination.
- Shield reservation, equipping, visible use, return and recovery have not been completely tested.
- Equipment return after defender death, dropped-item recovery, a broken Armory Rack, blocked navigation, chunk unloading, server restart during an attack and corrupted or partially missing loan data still require broader live testing.
- Legacy loan records did not store complete item components. Recovery can recreate the base registered item, but cannot reconstruct old enchantments, custom names, durability or other components that were never saved.
- Equipment is local to its settlement record. Settlement fragmentation or an unreachable Armory Rack can cause an otherwise valid Armorer or Weaponsmith to be rejected for missing equipment.

 

Recovery, compatibility and performance

- Post-attack repair, resource consumption, protection of player-modified blocks, and interrupted recovery have automated coverage but still need full survival-world testing.
- Persistence has automated tests, but restart behavior during every defence state and with active loans has not been fully tested in a real server session.
- Dedicated-server play, multiplayer synchronization, late joining, multiple settlements under attack at once, and long-running crowded-village performance have not been fully verified.
- Optional integration with Villager AI, Villager Identity, and Villager Types has not been fully exercised in the latest live test. The mod includes standalone fallbacks, but combinations with projects that heavily replace villager behavior may vary.
- Heavily modified raids or hostile entities may require the provided compatibility tags or dedicated integration before the defense system recognizes them correctly.
- Complex terrain and other projects that replace villager combat, memory, navigation, rendering, or iron golem targeting may conflict with this release.
- Debug mode can produce a large amount of state, role, threat, equipment, navigation, and animation logging.
- Development logs still contain minor missing item-tag translation warnings used by recipe-viewer naming. These do not stop the build or normal gameplay, but the warnings remain to be cleaned up.
- Short server `Can't keep up` warnings were observed around teleportation and chunk generation. They were not proven to be caused by the defense system and extended performance testing is still required.

 

Reporting problems

Please include the Village Defenders version, Minecraft version, Fabric Loader version, Fabric API version, full logs, relevant configuration, world seed, coordinates, settlement state, installed project list and clear reproduction steps when reporting a problem.

This mod has no related projects