HomeJavaModsProgressive Mechanics Library
Progressive Mechanics Library
ModsJava

Progressive Mechanics Library

by Kettle5000 · on CurseForge

⬇ Download on CurseForge

This is a library mod aimed to allow my mods and other mods have great control over damage and some combat mechanics
By default this mod does this
Modifies damage type done when landing a critical strike, allowing mods to easily track down if an attack is a critical hit. Damage type is "pml:player_critical"
Modifies damage type done when dealing a sweeping attack. Damage type is "pml:sweeping_damage".

For Mod developers
It adds a new way to register and add damage bonuses and reductions alongside making this work with First Aid Mod to allow control over damaged bodyparts

The DamageControl class is a core component. It provides a structured way to modify, control, and calculate damage values before they are applied in the game.

This system allows for multiple modifiers, including flat bonuses, percentage-based bonuses, and reductions from armor, enchantments, and special mechanics.


🔧 How It Works:


📊 Breakdown of Variables:

🛠️ Modifiers for Increasing Damage

Variable Description
baseFlatBonus Flat bonus added before percentage multipliers (e.g., +10 damage).
basePercentBonus Percentage-based increase applied before other calculations (e.g., 1.2 multiplier).
flatBonus Flat bonus added after base bonuses (e.g., +5 damage).
percentBonus Percentage-based increase applied after base calculations.

🛡️ Modifiers for Reducing Damage

Variable Description
weapondamagecontrol Controls weapon-based scaling before all calculations.
armorReduction Damage reduced due to armor (handled separately).
enchReduction Damage reduced due to enchantments (handled separately).
specialReduction Directly reduces final damage, so it must be used carefully.

📌 Original Values for Reference

 

Variable Description
originalDamage Stores the final damage after all calculations, ready for LivingDamageEvent.
originalAbsorption Stores the absorption value before modifications.

 

🛠️ Key Methods

 
Adds a new Event FirstAidHurtEvent, works as LivingHurtEvent but keeps track of equipmentslot pieces.

grants access to damage modification and the method 

 

getDamagedSlot()  returns the equipment slot damaged before armor and enchantments have been calculated when First Aid is added.

 

🛠️ Key Methods

🔍 getDamagedBodyPart(Player player)

Purpose: Retrieves the body part that was damaged. Returns a EquipmentSlot var corresponding to the bodypart damaged.
💡 Usage:

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Progressive Mechanics Library is a free Minecraft Java mod. Compatible with Minecraft 1.20.1, 1.20.2, 1.20.3. Downloaded 473,344 times (via CurseForge). Download it and open it directly in the game.

Explore more