Progressive Damage Mechanics in Minecraft
This library modification provides developers with advanced control over the damage system and combat mechanics in the game.
Core Features
The mod introduces changes to the standard damage system:
- Critical strikes are now marked with special damage type
pml:player_critical - Sweeping attacks receive identifier
pml:sweeping_damage - Standard methods for detecting critical and sweeping attacks are replaced with more reliable ones
For Mod Developers
The DamageControl system enables deep customization of damage calculations through various modifiers before damage is directly applied.
Working Mechanism
The calculation process includes several stages:
- Initial damage is adjusted based on weapon characteristics
- Base bonuses are applied (fixed and percentage-based)
- Additional bonuses are added
- Reductions from armor, enchantments, and special effects are subtracted
- The final value becomes available for adjustment through
LivingDamageEvent
Modifier Types
Damage Increase:
baseFlatBonus- fixed addition before percentage multipliersbasePercentBonus- percentage increase before main calculationsflatBonus- additional fixed additionpercentBonus- percentage bonus after basic computations
Damage Reduction:
weapondamagecontrol- weapon-based scalingarmorReduction- reduction from armorenchReduction- protection from enchantmentsspecialReduction- direct reduction of final damage
Key Methods
Armor System:
getArmorReduction()returns the amount of damage reduction from armor- Use
setArmorReduction(float value)to set values
Enchantment Protection:
getEnchantmentReduction()shows reduction from defensive enchantments- Useful for balancing effects and displaying in tooltips
Special Protection:
getSpecialReduction()provides direct damage reduction- Requires careful use as it can completely block damage
First Aid Compatibility
The system is integrated with the First Aid modification for precise identification of damaged player body parts in damage events.
getDamagedBodyPart(Player player) returns the equipment slot corresponding to the damaged area of the target.