Mebahel's RPG - Resistance & Weakness

A lightweight and highly configurable combat framework that transforms Minecraft into a tactical experience by adding comprehensive physical (Slash, Pierce, Blunt) and elemental resistance and weakness systems to every mob.

18

Mebahel's RPG - Resistance & Weakness

src="https://www.youtube.com/embed/Edmsk5o1k_I" frameborder="0" allowfullscreen> </iframe>

In this video, you can see hit markers of different colours depending on weapon efficiency. There is also a red or green hit marker at the right of the crossair depending on element efficiency.

Mebahel RPG Resistance & Weakness

Mebahel RPG Resistance & Weakness is a lightweight combat API and balancing framework for Minecraft that includes out-of-the-box support for vanilla mobs as well as creatures from Mebahel's Creatures - Draugr Invasion and Dwarven Automatons, requiring no initial configuration. It adds configurable damage multipliers based on both physical weapon types and elemental damage types, allowing entities to react uniquely to swords, arrows, maces, fire, frost, or any custom element added by other mods.

The goal is simple: make combat feel more readable, more tactical, and easier to balance across vanilla mobs, modded mobs, and large RPG-style modpacks.

***

Dependencies

Forge / NeoForge

* Sinytra Connector * Forgified Fabric API

Fabric

* Fabric API

***

Core Features

* Physical damage categories: Frost, Frost, and Frost * Elemental damage categories: Frost and Frost * Extensible custom elements, such as Holy, Poison, Arcane, Lightning, or any custom element a modder wants to register * Fully configurable entity multipliers through `entities.json` * Datapack support for preset balancing * Datapacks can automatically add missing entries to the config without overwriting player edits * Optional hitmarker feedback for physical and elemental effectiveness * Colorblind-friendly hitmarker mode * Safe support for entity IDs from mods that are not currently installed

***

Damage Types

The default system separates damage into two layers.

| Layer |Types |Purpose | | --------- |-------------------- |------------------------------------------ | | Physical |Slash, Pierce, Blunt |Represents the weapon or attack shape | | Elemental |Fire, Frost |Represents magical or elemental properties |

Both layers can apply at the same time.

For example, a frost arrow may be detected as:

| Layer |Detected Type | | --------- |------------- | | Physical |Pierce | | Elemental |Frost |

The final damage is calculated as:

`finalDamage = baseDamage × physicalMultiplier × elementalMultiplier`

***

Multiplier Rules

| Multiplier |Meaning | | ---------- |-------------------------- | | <code>1.0</code> |Neutral damage | | <code>&gt; 1.0</code> |Weakness, increased damage | | <code>&lt; 1.0</code> |Resistance, reduced damage | | <code>0.0</code> |Full immunity |

Recommended balancing range for most mobs is between `0.75` and `1.25`.

***

Default Vanilla Balance Overview

The default preset is designed to keep vanilla combat familiar while adding meaningful RPG-style advantages.

| Entity |Slash |Pierce |Blunt |Fire |Frost | | -------------------------- |----- |------ |----- |---- |----- | | <code>minecraft:zombie</code> |1.0 |0.9 |1.1 |1.25 |0.9 | | <code>minecraft:husk</code> |1.0 |0.9 |1.1 |1.2 |0.95 | | <code>minecraft:drowned</code> |1.0 |0.9 |1.1 |1.1 |1.0 | | <code>minecraft:zombie_villager</code> |1.0 |0.9 |1.1 |1.25 |0.9 | | <code>minecraft:skeleton</code> |1.0 |0.95 |1.15 |1.1 |0.9 | | <code>minecraft:stray</code> |1.0 |0.95 |1.15 |1.15 |0.85 | | <code>minecraft:wither_skeleton</code> |1.0 |0.95 |1.1 |0.85 |1.1 | | <code>minecraft:creeper</code> |1.0 |1.05 |0.9 |1.1 |0.95 | | <code>minecraft:spider</code> |1.1 |0.95 |0.95 |1.2 |0.9 | | <code>minecraft:cave_spider</code> |1.1 |0.95 |0.95 |1.2 |0.9 | | <code>minecraft:witch</code> |1.0 |1.0 |1.0 |1.1 |0.95 | | <code>minecraft:pillager</code> |1.0 |1.0 |1.0 |1.0 |1.0 | | <code>minecraft:vindicator</code> |1.0 |1.0 |1.05 |1.0 |1.0 | | <code>minecraft:evoker</code> |1.0 |1.0 |1.0 |1.1 |0.95 | | <code>minecraft:vex</code> |1.05 |1.05 |1.0 |1.1 |0.95 | | <code>minecraft:ravager</code> |0.95 |0.9 |1.1 |1.05 |0.95 | | <code>minecraft:guardian</code> |0.95 |1.0 |1.05 |1.15 |0.9 | | <code>minecraft:elder_guardian</code> |0.95 |1.0 |1.1 |1.15 |0.9 | | <code>minecraft:slime</code> |1.0 |1.0 |1.1 |1.0 |1.0 | | <code>minecraft:silverfish</code> |1.0 |1.0 |1.1 |1.0 |1.0 | | <code>minecraft:endermite</code> |1.05 |1.0 |0.95 |1.1 |0.95 | | <code>minecraft:enderman</code> |1.0 |1.0 |0.95 |1.15 |0.9 | | <code>minecraft:shulker</code> |0.9 |0.9 |1.15 |1.0 |1.0 | | <code>minecraft:ender_dragon</code> |1.0 |0.95 |1.05 |0.9 |1.05 | | <code>minecraft:blaze</code> |1.0 |1.0 |1.0 |0.75 |1.25 | | <code>minecraft:magma_cube</code> |1.0 |1.0 |1.05 |0.8 |1.2 | | <code>minecraft:ghast</code> |1.0 |1.05 |0.95 |0.9 |1.1 | | <code>minecraft:piglin</code> |1.0 |1.0 |1.0 |1.05 |0.95 | | <code>minecraft:piglin_brute</code> |1.0 |1.0 |1.05 |1.05 |0.95 | | <code>minecraft:zombified_piglin</code> |1.0 |0.9 |1.1 |0.85 |0.95 | | <code>minecraft:hoglin</code> |1.0 |0.95 |1.1 |1.0 |1.05 | | <code>minecraft:zoglin</code> |1.0 |0.95 |1.1 |0.85 |1.05 | | <code>minecraft:wither</code> |1.0 |0.95 |1.0 |0.9 |1.05 | | <code>minecraft:warden</code> |1.0 |0.95 |1.05 |0.95 |0.95 | | <code>minecraft:phantom</code> |1.0 |1.1 |1.0 |1.1 |0.95 |

***

Built-In Mebahel Presets

The base config can also include presets for Mebahel ecosystem mobs. These entries are safe even if the related mods are not installed, because they are stored as entity ID strings.

Dwarven Automatons

| Entity |Slash |Pierce |Blunt |Fire |Frost | | ----------------------------------------------- |----- |------ |----- |---- |----- | | <code>mebahelcreaturesdwarven:dwarven_sphere</code> |0.8 |0.8 |1.4 |1.0 |1.0 | | <code>mebahelcreaturesdwarven:dwarven_centurion</code> |0.8 |0.8 |1.4 |1.0 |1.0 | | <code>mebahelcreaturesdwarven:dwarven_spider</code> |0.8 |0.8 |1.4 |1.0 |1.0 | | <code>mebahelcreaturesdwarven:dwarven_spider_guardian</code> |0.8 |0.8 |1.4 |1.0 |1.0 |

Dwarven automatons are metal constructs. They resist slashing and piercing damage, but are vulnerable to blunt impact.

Draugr Invasion

| Entity |Slash |Pierce |Blunt |Fire |Frost | | -------------------------------------------- |----- |------ |----- |---- |----- | | <code>mebahelcreaturesdraugr:draugr</code> |1.15 |0.9 |0.9 |1.2 |0.85 | | <code>mebahelcreaturesdraugr:draugr_archer</code> |1.15 |0.9 |0.9 |1.2 |0.85 | | <code>mebahelcreaturesdraugr:draugr_wight</code> |1.15 |0.9 |0.9 |1.2 |0.85 | | <code>mebahelcreaturesdraugr:draugr_scourge</code> |1.2 |0.85 |0.85 |1.15 |0.8 | | <code>mebahelcreaturesdraugr:draugr_overlord</code> |1.2 |0.85 |0.85 |1.15 |0.8 | | <code>mebahelcreaturesdraugr:skeleton_warrior</code> |1.1 |0.9 |0.9 |1.15 |0.9 | | <code>mebahelcreaturesdraugr:skeleton_warrior_head</code> |1.1 |0.9 |0.9 |1.15 |0.9 | | <code>mebahelcreaturesdraugr:infernal_draugr</code> |1.15 |0.9 |0.9 |0.75 |1.25 | | <code>mebahelcreaturesdraugr:flame_atronach</code> |1.0 |1.0 |1.0 |0.75 |1.25 |

Draugr are ancient undead warriors. They are weak to slashing damage and fire, but resist piercing, blunt impact, and frost.

***

Configuration Files

The mod creates its configuration in:

`config/mebahel-rpg_resistance-weakness/`

| File |Purpose | | ------------- |------------------------------------------------------------------- | | <code>config.json</code> |Damage detection, keywords, priorities, and client feedback options | | <code>entities.json</code> |Entity-specific resistance and weakness multipliers |

***

Entity Configuration

`entities.json` controls the actual damage multipliers for each mob.

Example:

``` { "entities": { "minecraft:zombie": { "mebahelrpgresistanceweakness:slash": 1.0, "mebahelrpgresistanceweakness:pierce": 0.9, "mebahelrpgresistanceweakness:blunt": 1.1, "mebahelrpgresistanceweakness:fire": 1.25, "mebahelrpgresistanceweakness:frost": 0.9 } } } ```

This means:

| Damage Type |Multiplier |Result | | ----------- |---------- |-------------------- | | Slash |1.0 |Neutral | | Pierce |0.9 |10% reduced damage | | Blunt |1.1 |10% increased damage | | Fire |1.25 |25% increased damage | | Frost |0.9 |10% reduced damage |

***

Detection Configuration

Damage detection is configured in `config.json`.

The mod detects damage types using stable IDs and translation keys from weapons, projectiles, and items. This avoids relying on translated display names or custom item names.

Example detection section:

``` { "elementDetection": { "physicalPriority": [ "mebahelrpgresistanceweakness:blunt", "mebahelrpgresistanceweakness:pierce", "mebahelrpgresistanceweakness:slash" ], "elementalPriority": [ "mebahelrpgresistanceweakness:frost", "mebahelrpgresistanceweakness:fire" ], "needles": { "mebahelrpgresistanceweakness:slash": [ "sword", "blade", "slash", "claw", "claymore", "cutlass", "katana", "scythe", "sickle", "dagger", "axe", "war_axe", "halberd" ], "mebahelrpgresistanceweakness:pierce": [ "arrow", "bow", "bolt", "trident", "spear", "lance", "javelin", "rapier", "pierce" ], "mebahelrpgresistanceweakness:blunt": [ "mace", "hammer", "warhammer", "club", "blunt", "anchor", "fist", "pickaxe", "staff", "wand" ], "mebahelrpgresistanceweakness:fire": [ "fire", "flame", "burn", "lava", "inferno" ], "mebahelrpgresistanceweakness:frost": [ "frost", "ice", "freeze", "snow", "stalhrim" ] } } } ```

Physical Priority

`physicalPriority` decides which physical type wins when a weapon matches multiple keywords.

For example, `pickaxe` contains `axe`, but it should be treated as blunt. Placing `blunt` before `slash` ensures pickaxes are classified correctly.

Elemental Priority

`elementalPriority` decides which elemental type wins when a damage source matches multiple elemental keywords.

For example, a custom item containing both `fire` and `frost` keywords will use the first matching element in the priority list.

***

Client Feedback

The mod includes optional hitmarker feedback to show whether an attack was effective or resisted.

Config section:

``` { "clientFeedback": { "showPhysicalHitmarker": true, "showElementalHitmarker": true, "colorblindMode": false } } ```

| Option |Description | | ---------------------- |--------------------------------------------------------- | | <code>showPhysicalHitmarker</code> |Enables or disables the physical effectiveness hitmarker | | <code>showElementalHitmarker</code> |Enables or disables the elemental effectiveness hitmarker | | <code>colorblindMode</code> |Uses blue/orange instead of green/red |

Default Colors

| Result |Normal Mode |Colorblind Mode | | ---------------- |----------- |--------------- | | Effective damage |Green |Blue | | Resisted damage |Red |Orange | | Neutral damage |White |White |

The physical hitmarker uses a generic physical icon. The elemental hitmarker uses a generic elemental icon, making it compatible with custom elements such as Holy, Poison, Lightning, or Arcane.

***

Datapack Support

Datapacks can add new preset values for vanilla or modded mobs.

Datapack entity files go here:

`data/<namespace>/rpg_resweak/entities/<entity_namespace>/<entity_path>.json`

Example path:

`data/my_rpg_pack/rpg_resweak/entities/minecraft/zombie.json`

Recommended format:

``` { "mebahelrpgresistanceweakness:slash": 1.0, "mebahelrpgresistanceweakness:pierce": 0.9, "mebahelrpgresistanceweakness:blunt": 1.1, "mebahelrpgresistanceweakness:fire": 1.25, "mebahelrpgresistanceweakness:frost": 0.9 } ```

Legacy format is also supported:

``` { "multipliers": { "mebahelrpgresistanceweakness:slash": 1.0, "mebahelrpgresistanceweakness:pierce": 0.9, "mebahelrpgresistanceweakness:blunt": 1.1 } } ```

***

How Datapack Values Are Applied

Datapacks act as presets.

When a datapack is loaded:

* New entities are added to `entities.json` * Missing element multipliers are added * Existing player-edited values are never overwritten

This means datapacks are safe to use in existing worlds and modpacks.

Example:

If `entities.json` already contains:

``` { "entities": { "minecraft:zombie": { "mebahelrpgresistanceweakness:fire": 1.5 } } } ```

and a datapack provides:

``` { "mebahelrpgresistanceweakness:fire": 1.25, "mebahelrpgresistanceweakness:frost": 0.9 } ```

the final config keeps the player value and only adds the missing one:

``` { "entities": { "minecraft:zombie": { "mebahelrpgresistanceweakness:fire": 1.5, "mebahelrpgresistanceweakness:frost": 0.9 } } } ```

***

Loading Order

When damage is calculated, the mod checks values in this order:

| Priority |Source | | -------- |----------------- | | 1 |Runtime overrides | | 2 |<code>entities.json</code> | | 3 |Datapack values | | 4 |Fallback <code>1.0</code> |

In normal gameplay, `entities.json` is the main source of truth once generated.

***

Adding Custom Elements

Other mods can register new elemental damage types through the API. This is useful for RPG systems that need custom elements such as Holy, Poison, Lightning, Arcane, Shadow, or Radiant damage.

A custom element has two important parts:

| Part |Purpose | | ---------- |------------------------------------------------------------------------------------- | | Element ID |The unique identifier used in configs and datapacks, such as <code>my_mod:holy</code> | | Needles |The keywords used by the detector to recognize that an attack belongs to this element |

Example: registering a Holy element.

``` Identifier HOLY = new Identifier("my_mod", "holy");

RPGElements.registerElementalWithNeedles( HOLY, new ElementDefinition(HOLY), List.of( "holy", "sun", "light", "silver", "radiant" ) ); ```

The third argument, `List.of(...)`, defines the detection keywords for the element. The detector checks stable signatures built from weapon IDs, projectile IDs, item IDs, and translation keys. If one of these signatures contains a matching keyword, the attack can be classified as that element.

For example, the Holy element above may be detected from IDs such as:

| ID or Translation Key |Matching Needle | | ------------------------- |--------------- | | <code>my_mod:silver_sword</code> |<code>silver</code> | | <code>my_mod:holy_staff</code> |<code>holy</code> | | <code>item.my_mod.radiant_blade</code> |<code>radiant</code> | | <code>my_mod:sun_arrow</code> |<code>sun</code> |

Once the element is registered, it can be used in `entities.json` like any built-in element:

``` { "entities": { "minecraft:zombie": { "my_mod:holy": 1.25 } } } ```

This means zombies take 25% increased damage from attacks detected as `my_mod:holy`.

Custom elements can also be used in datapacks:

``` { "my_mod:holy": 1.25, "my_mod:poison": 0.75 } ```

Example datapack path:

`data/my_rpg_pack/rpg_resweak/entities/minecraft/zombie.json`

Detection Priority for Custom Elements

When a custom element is registered with `RPGElements.registerElementalWithNeedles(...)`, it can be added to `elementalPriority` in `config.json`.

Example:

``` { "elementDetection": { "elementalPriority": [ "my_mod:holy", "mebahelrpgresistanceweakness:frost", "mebahelrpgresistanceweakness:fire" ] } } ```

Priority matters when the same attack matches multiple elemental keywords. The first matching element in `elementalPriority` is selected.

For example, if an item ID is `my_mod:holy_fire_sword`, and both `holy` and `fire` match, the selected element depends on the order in `elementalPriority`.

Recommended Keyword Rules

For best compatibility, use lowercase English keywords that are likely to appear in item or projectile IDs.

Recommended:

``` List.of("holy", "sun", "light", "silver", "radiant") ```

Avoid overly generic keywords such as:

``` List.of("the", "magic", "item", "weapon") ```

Generic keywords can accidentally classify too many attacks as the custom element.

Custom elements are automatically supported by the generic elemental hitmarker. The hitmarker does not need a custom icon or color per element; it only indicates whether the elemental part of the attack was effective, resisted, or neutral.

***

API for Mod Developers

Mods can define default multipliers directly through the API.

Add the five base elements

``` MebahelsRPGWeaknessesResistances.addBasic( ModEntities.MY_ENTITY, 1.0f, // slash 0.9f, // pierce 1.2f, // blunt 1.25f, // fire 0.85f // frost ); ```

Add or update one default value

``` MebahelsRPGWeaknessesResistances.putDefault( ModEntities.MY_ENTITY, new Identifier("my_mod", "holy"), 1.25f ); ```

`putDefault` is safe. It only writes a value if the player has not already configured one.

Force a runtime and config override

``` MebahelsRPGWeaknessesResistances.setMultiplier( ModEntities.MY_ENTITY, new Identifier("my_mod", "holy"), 1.5f ); ```

This is intended for commands, debug tools, or admin-side balancing. It overwrites the config value.

***

Notes for Modpack Authors

* Use datapacks to distribute balancing presets * Use `entities.json` for final server-side tuning * Keep most values between `0.75` and `1.25` unless designing high-impact mechanics * Avoid setting values to `0.0` unless full immunity is intentional * Entity IDs from missing mods are safe; they remain unused until the relevant mod is installed * Datapacks will not overwrite player or server edits already present in `entities.json`

***

Summary

Mebahel RPG Resistance & Weakness provides a clean, configurable RPG combat layer for Minecraft. It gives modders and modpack authors a flexible way to make enemies feel distinct without hardcoding balance into entity classes.

Whether you want skeletons to fear maces, automatons to resist arrows, fire creatures to shrug off flames, or undead to burn under holy magic, this mod provides the framework to do it cleanly.

ADS