Progressive Mechanics Library

Quick rating

Progressive Mechanics Library

No reviews yet

Library mod aimed to allow mod creators for deep control over damage mechanics.

No Theme
No Genre
Mod Addon
API/Library
Mod Loaders
Forge
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Required
Server Required

About

Project Details

Type
Mod
License
All Rights Reserved
Latest Version
pml-1.0.4b-all.jar
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

CurseForge ID
Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

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:

  • The system starts with raw base damage.

  • It applies weapon-specific scaling (reducing damage before further calculations).

  • Base bonuses are applied first (flat and percentage-based).

  • Additional bonuses are applied next (flat and percentage-based).

  • The system calculates reductions (armor, enchantments, special reductions).

  • The final damage is stored and can be retrieved or modified in LivingDamageEvent.


📊 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

  • 🛡️ getArmorReduction() 
    Returns: The amount of damage reduction due to armor.
    💡 Usage: This value is set by setArmorReduction(float value) and represents the amount of damage blocked by armor-based mechanics
    (e.g., vanilla armor calculations or custom armor effects from other mods).
  • 🔮 getEnchantmentReduction()
    Returns: The amount of damage reduction caused by enchantments.
    💡 Usage: This tracks how much defensive enchantments (such as Protection or custom enchantments) reduce the final damage. Mods can use this to balance enchantment effects or display them in tooltips.
  • ⚠️ getSpecialReduction()
    Returns: The amount of direct damage reduction applied through special mechanics.
    💡 Usage: This is the most powerful form of damage reduction, as it is subtracted at the very end of the damage calculation. Mods should use this carefully because it can completely negate damage if too high.

    📌 First Aid Mod Compatibility System

    This system integrates with the First Aid mod, which modifies how damage is handled by introducing body-part-specific injuries. The following code helps track which body part was damaged when using the First Aid mod and ensures compatibility with the DamageControl system.

🛠️ Key Methods

🔍 getDamagedBodyPart(Player player)

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

  • This method should only be used during LivingDamageEvent and when First Aid is present.

  • If the player isn't mapped, it returns null.



One example of use is inside the mod Forgotten Nunchakus.

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: The system starts with raw base damage.

It applies weapon-specific scaling (reducing damage before further calculations).

Base bonuses are applied first (flat and percentage-based).

Additional bonuses are applied next (flat and percentage-based).

The system calculates reductions (armor, enchantments, special reductions).

The final damage is stored and can be retrieved or modified in LivingDamageEvent.

📊 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 ✔️ Adding Bonuses 🛡️ getArmorReduction() ✅ Returns: The amount of damage reduction due to armor. 💡 Usage: This value is set by setArmorReduction(float value) and represents the amount of damage blocked by armor-based mechanics(e.g., vanilla armor calculations or custom armor effects from other mods). 🔮 getEnchantmentReduction() ✅ Returns: The amount of damage reduction caused by enchantments. 💡 Usage: This tracks how much defensive enchantments (such as Protection or custom enchantments) reduce the final damage. Mods can use this to balance enchantment effects or display them in tooltips. ⚠️ getSpecialReduction() ✅ Returns: The amount of direct damage reduction applied through special mechanics. 💡 Usage: This is the most powerful form of damage reduction, as it is subtracted at the very end of the damage calculation. Mods should use this carefully because it can completely negate damage if too high.

📌 First Aid Mod Compatibility System This system integrates with the First Aid mod, which modifies how damage is handled by introducing body-part-specific injuries. The following code helps track which body part was damaged when using the First Aid mod and ensures compatibility with the DamageControl system.

🛠️ Key Methods 🔍 getDamagedBodyPart(Player player)

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

This method should only be used during LivingDamageEvent and when First Aid is present.

If the player isn't mapped, it returns null.

One example of use is inside the mod Just a lot more Enchantments.

Screenshots

Gallery

This project has no gallery images yet.

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

~560,000
Total Downloads
CurseForge
~440,000
Modrinth
~120,000
Last Updated
CurseForge
Modrinth
Created
CurseForge
Modrinth
Last synced
When ModDex last fetched this project from CurseForge or Modrinth. Every project is re-checked on a schedule, and any project that ships a new file is synced automatically within hours of the release.
New file updates sync automatically
How syncing works