Auto Defend
Auto Defend gives entities a new resource: Stamina, which is by default 20 for all entities but can be changed with the max_stamina attribute. Instead of losing health, hit entities will automatically parry or dodge attacks, redirecting any damage taken to their stamina instead. The conditions to accomplish auto defense are fairly customizable:
- By default, only players can auto defend. This can be altered in the config.
- Entities in the
#auto_defend:no_auto_defenseentity type tag (by default ranged mobs and large, tanky mobs) cannot auto defend. - By default, damage not directly from a living entity source (mainly projectiles and environmental damage) cannot be auto defended against. Damage in the
#auto_defend:undefendabledamage type tag cannot be auto defended, either - this includes explosions and sonic booms by default. - If the damage is substantially higher than the defender's max stamina, they will be "overbroken", setting their stamina to 0 and causing them to take the attack in full. Overbreak conditions are configurable, including how much damage needs to be done to overbreak and whether overbreaks are measured against current or maximum stamina.
- If the entity is not looking within a certain angle of the damage source (defined by their
defend_angleattribute), they will not auto defend attacks. - Entities with a
defend_chanceattribute lower than 1.0 have a random chance to fail to defend.defend_chanceis set to 1.0 by default, so players don't need to worry about taking health damage because of RNG.
Stamina
Damage dealt to stamina is raw damage, before mitigation from anything like armor, Protection, or Resistance. However, the endurance attribute reduces stamina damage.
Stamina naturally regenerates after enough time has passed since you were last hit. For players, this consumes hunger; players cannot regenerate stamina when below half hunger. Values pertaining to stamina regeneration are configurable.
Although stamina has no UI elements, entities below half stamina will visibly sweat. The more rapidly an entity sweats, the lower their stamina. Additionally, when an entity's stamina is taken to 0 by a parry or dodge, the visual and audio effects will change to indicate this. This change is configurable, if you'd rather keep players guessing about exactly how long they can keep defending.
Compatibility
Auto Defend may not function properly with mods that add their own methods of negating damage. The main issue you might find is auto defense taking priority over the modded damage negation. There's no guarantee on what mods will or will not work; your best bet is to try it and see. I've personally confirmed proper functionality with:
and confirmed incompatibility with:
- Shield & Parry (auto defense takes priority over parrying. Since the mod is closed source, I can't fix this.)
Notices
This mod is heavily attribute driven. Use of AttributeSetter is highly recommended for pack developers and anyone that wants to change functionality.
I can only promise functionality on 1.21.1, but feel free to try it and see if it works on later 1.21.x releases.
So, why does this mod even exist? **(WARNING: BIG OL' TEXT WALL)**
In Minecraft, entity health is noticeably small relative to damage. This means that small damage differences don't have much time to compound, so all that matters is specific break-points. For instance, stone swords (5 damage) and iron swords (6 damage), if we ignore crits, both take 4 hits to kill a 20-damage target.This is an issue when combined with some weapon mods, where damage differences between weapon types can be rather small.
Increasing HP values is one way to get around this. Against a 100-HP target, the same 5-damage stone sword and 6-damage iron sword now take 20 and 17 hits to kill respectively; a small but real difference. The default configs don't really achieve this, but they're meant to be less game-altering as a baseline.
However, I have a personal issue with inflating HP: it feels somewhat stupid in certain flavors of modpack. Damage differences mattering is in contrast with combat feeling lethal.
Auto Defend solves this issue by making the vast majority of hits not actually HURT you: you avoid them, but become more and more exhausted over time until you are finished off by a decisive strike.
No gallery available for this project.