Skip to content

SlimeeyYt/HealthBasedMobScaling

Repository files navigation

Health-Based Mob Scaling Mod

A Minecraft Fabric mod that dynamically scales mob size and step height based on their current health.

Features

  • Dynamic Mob Scaling: All living entities automatically change size based on health
  • Step Height Adjustment: Mobs can climb higher as they gain health
  • Performance Optimized:
    • Updates only every 20 ticks (once per second)
    • Only affects entities within 128 blocks of players
  • Safe Implementation: Proper attribute existence checks and value clamping
  • Configurable: Easy to modify multipliers and limits

How It Works

For every living entity:

  • Scale = Current Health × 0.25 (max 10.0)
  • Step Height = Current Health × 0.125 (max 5.0)

Example Calculations

Mob Health Scale Step Height
10 HP 2.5 1.25
20 HP 5.0 2.5
30 HP 7.5 3.75
40 HP 10.0 (capped) 5.0 (capped)

Installation

  1. Download the latest JAR from releases
  2. Place the JAR in your .minecraft/mods folder
  3. Launch Minecraft with the Fabric Loader

Configuration

Edit ScalingConfig.java to customize:

SCALE_MULTIPLIER = 0.25f;           // Scale per health point
STEP_HEIGHT_MULTIPLIER = 0.125f;    // Step height per health point
MAX_SCALE = 10.0;                   // Maximum scale limit
MAX_STEP_HEIGHT = 5.0;              // Maximum step height limit
ENTITY_CHECK_RANGE = 128.0;         // Range from players to affect entities
UPDATE_INTERVAL = 20;               // Ticks between updates (20 = 1 second)

Building

Requirements:

  • Java 21 JDK
  • Gradle

Build commands:

gradle build                    # Build the mod
gradle publishToMavenLocal     # Publish to local Maven repository

The built JAR will be in build/libs/health-scaling-mod-*.jar

Technical Details

  • Framework: Fabric API 0.100.5
  • Minecraft Version: 1.21.1
  • Loader Version: 0.15.11+
  • Language: Java 21

Attributes Used

  • minecraft:generic.scale - Controls entity size
  • minecraft:generic.step_height - Controls climbing height

Performance

  • Tick Updates: Every 20 ticks (1 second)
  • Range Check: Only entities within 128 blocks of players
  • Safe Iteration: No entity position modifications, only attribute changes

License

MIT License

Credits

Created by Slimeey Studios


Note: This mod requires Fabric Loader and Fabric API to function.

About

A Minecraft mod where mobs dynamically scale in size and step height based on their health.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages