Перейти к содержимому
Mineforgian

[AN]Adaptive Nemesis

The dynamic difficulty balancing module specifically designed for integration packs aims to address the issue of difficulty imbalance in current mainstream integration packs, where the early game is too easy and the late game is too challenging.

Загрузки
564
Подписчики
2
Обновлён
27 июня 2026 г.
Лицензия
MIT

Опубликован 1 мая 2026 г.

⚔️ Adaptive Nemesis / 自适应宿敌 ⚔️

"Your power feeds their evolution"


📖 Overview

Adaptive Nemesis is a NeoForge 1.21.1 dynamic difficulty balancing mod designed specifically for Minecraft modpacks.

It solves the common modpack problem where early game feels like "scratching with a toothpick" while late game becomes "one-shotting everything." By intelligently evaluating player strength and dynamically adjusting enemy attributes, combat always maintains that "a bit hard, but not too much" thrilling tension.


⚔️ Core Mechanics

1. Player Strength Evaluation System

The mod continuously monitors each player's comprehensive combat power, assessing based on multi-dimensional data:

Dimension Description Weight
🛡️ Defense Armor value, max health, armor toughness High
⚔️ Offense Attack damage, attack speed, weapon enchantment level High
Mythic Affixes Apotheosis equipment quality and tier Medium
🔮 Iron's Spells Iron's Spells 'n Spellbooks mana pool, spell power Medium
🗡️ Epic Fight Epic Fight stamina value, combat style Medium

All weights can be customized via configuration files, with KubeJS script support for extended evaluation logic!

2. Dynamic Enemy Scaling

When hostile mobs spawn, the mod provides adaptive attribute bonuses based on the average strength of nearby players:

Scaling Type Description Cap
Health Max health increase 500%
Damage Attack damage increase 500%
Armor Physical defense increase 300%
Attack Speed Prevents infinite stunlock -
Spell Power Iron's Spells compatibility -
Spell Resistance Iron's Spells compatibility -
Hit Resistance Epic Fight compatibility -
Knockdown Resistance Epic Fight compatibility -
Stamina Epic Fight compatibility -

Attribute Random Distribution: Each spawned enemy's attributes will fluctuate around the base value (70%~130%), making every battle unpredictable!

Base Scaling = Player Comprehensive Strength × Difficulty Coefficient
Float Adjustment = Base Scaling × (0.7 ~ 1.3)  // Attribute random distribution

3. True Damage Conversion (Iron Turtle Terminator)

For high-armor players, the mod forcibly converts a portion of damage into armor-ignoring true damage:

Armor Level True Damage Ratio
Standard Armor (≤20) 5%
Enhanced Armor (20~50) 15%
High Armor (50~100) 25%
Iron Turtle (>100) 35%

Never fear becoming invincible with god gear! Enemies will find your weakness 🔥

4. Adaptive Float System

Dynamically adjusts difficulty based on real-time player performance:

Player Behavior System Response
Consecutive Kills Float multiplier +10% (enemies grow stronger)
Frequent Deaths Float multiplier -15% (giving you breathing room)
Long Inactivity Float multiplier resets to baseline

💡 Goal: Always make players feel "a bit hard, but not too much" — just the right challenge

5. Nemesis Memory System

Each player has an independent Nemesis profile. Enemies remember your combat style and evolve accordingly:

Memory Type Records Enemy Evolution Direction
Kill Preference Player's common kill methods Enemies gain corresponding resistances
Death Records Damage sources when player dies Enemies learn corresponding attack patterns
Equipment History Equipment combinations player has used Enemies evolve targeted counter-strategies
Behavior Patterns Melee/ranged/magic preferences Enemies adjust AI behavior

6. Newbie Protection Mechanism

Provides thoughtful protection for low-strength players:

Trigger Condition Effect Duration
Player Comprehensive Strength < Threshold Monster attributes -30% Configurable
First Death Protection time +10 minutes Cumulative cap
3 Consecutive Deaths Force enable protection Until any enemy is killed

7. Boss Mechanics

Prevents players from one-shotting Bosses, extending epic combat experiences:

  • Damage Cap: Single-hit damage has an upper limit (default 100), which increases as Boss health decreases
  • Attribute Amplification: Boss health ×5, damage ×3
  • Combat Tracking: Records combat duration and cumulative damage
  • Phase Evolution: Bosses dynamically adjust attack patterns based on combat duration

🔗 Mod Compatibility

Adaptive Nemesis natively supports the following popular mods:

Mod Compatible Content
🔮 Iron's Spells 'n Spellbooks Spell power, mana pool, cooldown reduction, magic resistance
⚔️ Epic Fight Hit resistance, impact, armor breaking, combos, stamina
Apotheosis Equipment quality, mythic affix tier evaluation
📦 KubeJS Custom events, script extensions, config hot reload

⌨️ Commands

All commands use /an prefix, requiring OP permission (level 2):

Command Description
/an status View mod current running status
/an strength [player] View specified player's strength evaluation data
/an difficulty View/adjust difficulty settings
/an protection [player] View/manage newbie protection status
/an memory [player] View Nemesis memory profile
/an scan [range] Scan surrounding enemies' scaling data
/an nemesis [type] Summon Nemesis
/an test [module] Test mod module functions
/an reload Reload configuration files
/an help Display help information

⚙️ Configuration System

All mod mechanisms can be finely adjusted through configuration files

  • Config file path: config/adaptive_nemesis-common.toml

🔧 KubeJS Integration

Automate mod configuration through scripts:

Available Events

Event Name Trigger Timing Purpose
adaptive_nemesis.entity_scale When entity attributes are scaled Customize specific entity scaling multipliers
adaptive_nemesis.damage_calculation When true damage is calculated Adjust damage values or cancel conversion
adaptive_nemesis.player_strength_evaluation When player strength is evaluated Modify final strength calculation
adaptive_nemesis.nemesis_memory_update When Nemesis memory updates Listen for milestones or custom rewards

Practical Scenarios

Scenario Implementation
Extra zombie scaling Check entity ID, multiply scaling
Boss double scaling Check boss type, multiply scaling
High-level player difficulty Add strength based on player level
Milestone rewards Listen for every-10-kills event, grant rewards
Global difficulty adjustment Define global coefficient, unified multiplication

📦 Datapack Support(In the Plan)

Extend mod content through datapacks without writing code:

  • Custom Nemesis types
  • Define entity transformation rules
  • Configure special scaling effects
  • Override default difficulty parameters

🚀 Performance Optimization

Optimization Solution Effect
Entity Calculation Regional caching + async update Reduce real-time calculation overhead
Multiplayer Server TPS Client prediction + server validation Reduce server load
Config Hot-Update Incremental sync, not full reload Avoid lag spikes
Memory System Storage On-demand loading, periodic archiving Control save file size

📖 Design Philosophy

"Your power feeds their evolution"

Adaptive Nemesis's core concept is dynamic balance:

  1. Never weaken players — Players can still enjoy the thrill of growing stronger
  2. Match enemies to strength — Enemies always scale with player power
  3. Learn and counter — Enemies learn player combat styles and evolve targeted counters
  4. Protect newbies — Give new players enough room to grow
  5. Challenge veterans — Keep experienced players constantly challenged
  • Whether you're a newcomer just starting a modpack or a veteran in full god gear, Adaptive Nemesis provides just the right combat experience!

⚔️ Every time you grow stronger, your Nemesis evolves ⚔️

CurseForge Modrinth GitHub

Ченджлог

1.0.10Релиз1.21.1 · 27 июня 2026 г.

⚔️ Adaptive Nemesis v1.0.10 ⚔️

Tired of squinting at tiny input boxes? So were we.

Now you can edit those long lists in comfort.


📋 What's New

Type Change Details
✨ Added Long Text Edit Screen A dedicated modal for editing lengthy config fields
🔧 Reworked Config UI Replaced cramped input boxes with preview buttons + popup editing
📦 Bumped Mod Version 1.0.91.0.10
🧹 Cleaned Temp Files Removed the temporary refactor review report

🎯 Why This Matters

Ever tried editing a massive entity blacklist or a long list of Boss exclusions in a tiny 320px-wide box? Painful.

Now those fields show a preview button (first 16 chars) that opens a full-screen modal with:

  • 🖊️ A wide, adaptive text box (up to 640px)
  • 🔢 Live character count badge
  • ✨ Smooth fade-in animation
  • 🟠 Clean, dark-themed UI matching the main config screen

🔄 Affected Config Fields

Config Field What It Does
Boss Damage Cap Exclusions List of bosses immune to the damage cap system
Entity Blacklist Entities excluded from adaptive scaling
Debug Log File Path Custom path for debug output

⚠️ Heads Up

No breaking changes. Your existing config files will work exactly as before.

The only difference is how you edit them — and it's a lot nicer now.


💡 Tip: Found a bug or have a suggestion? Open an issue on the repo! ✨ Long Text, Made Easy ✨ GitHub

1.0.9Релиз1.21.1 · 18 июня 2026 г.

🌟 Anadaptive Nemesis – Update 1.0.9

“The Smooth Operator” Release

We cleaned up the guts of the mod so you can enjoy a smoother, fairer, and more responsive experience – without even noticing the work behind the scenes.


🎯 TL;DR – What’s New for You?

  • ⚡ Game feels faster – less lag, especially on busy servers or when lots of mobs are around.
  • 🎯 Boss fights are more consistent – bosses are now properly recognised, so their special damage caps work every time.
  • 🛡️ True damage (armour‑bypassing damage) is now smarter – high‑armour players won’t get unfairly one‑shot.
  • 📈 Difficulty scaling is smoother – no more random difficulty spikes that feel like cheating.
  • 🔧 Configuration is easier for pack makers – but for you, it just means fewer bugs and faster updates.
  • 🐛 Lots of bugs squashed – including some that could crash your game or break boss fights.

🚀 Performance – Your TPS Just Got a Raise

We made the mod much more efficient under the hood. Here’s what you’ll actually feel:

  • Boss checks are now cached – so the game doesn’t waste time re‑checking if something is a boss every single hit. Result: smoother combat.
  • Player tracking is smarter – the mod only looks at nearby players when scaling enemies, instead of scanning the whole server. Multiplayer servers will thank you.
  • Item and enchantment lookups are pre‑computed – so when a mob spawns, the game already knows what gear to give it. Faster spawns, less stutter.

In numbers: we saw up to 99% faster in some internal operations – which translates to noticeably less lag in big battles or crowded worlds.


🐛 Major Bug Fixes – The Ones That Mattered

Issue What was broken Now it’s fixed
Boss misidentification Some modded bosses weren’t recognised as bosses, so their damage caps and special rules didn’t apply. Bosses are now correctly identified every time – fair fights, no surprises.
True damage miscalculation High‑armour players sometimes took way too much armour‑bypassing damage. True damage now scales in stages – tanky players get the protection they deserve.
Difficulty spikes The difficulty curve had sharp jumps that felt unfair. We switched to a standard smooth formula – difficulty ramps up gradually and naturally.
Local difficulty dilution Players far away could affect the difficulty near you (making it easier or harder incorrectly). Now only nearby players influence your local scaling – your fight, your challenge.
Crash risks Some edge cases could cause the game to crash when scaling certain modded mobs. We added better error handling – no more mysterious crashes.

⚙️ Behind the Scenes – What Pack Makers Should Know

If you’re a modpack creator or a tinkerer:

  • The configuration file has been split into smaller, logical sections – much easier to find and tweak settings.
  • All old config options still work (we kept compatibility), but you’ll see new categories if you regenerate the config.
  • Debug logging is improved – if something goes wrong, the logs will tell you exactly what and where.

📊 Performance Gains – By the Numbers (if you like numbers)

Area Improvement
Boss identification ~88% faster
Enchantment/equipment lookups ~99% faster
Player spatial indexing ~26% faster tick time
Random number generation ~61% faster
Reflection calls (for KubeJS) ~59% faster

All of this means less CPU usage and more TPS for your world.

1.0.8Релиз1.21.1 · 18 июня 2026 г.

The issue of the server not being able to start has been resolved

1.0.7Бета1.21.1 · 13 июня 2026 г.



⚔️ Adaptive Nemesis v1.0.7 ⚔️

Every time you grow stronger, your Nemesis evolves


📋 TL;DR

Item Description
Impact Scope High — Fixes server deadlock/crash issues and refactors Boss attribute amplification
Core Changes Watchdog service, chunk loading deadlock fix, dynamic weapon damage cap, Boss anti-HP-explosion

🐕 Watchdog Service (New)

File: WatchdogService.java (New)

Monitors server main thread for deadlocks, auto-detects and outputs thread dumps.

Config Type Default Description
enableWatchdog Boolean true Enable watchdog service
watchdogCheckInterval Int 5 Check interval (seconds)
watchdogWarnThreshold Int 30 Warning threshold (seconds)
watchdogCriticalThreshold Int 60 Critical threshold (seconds)

Two-Level Detection:

  • ⚠️ Warning (30s): Logs current entity being processed
  • 🚨 Critical (60s): Outputs full thread dump, marks problematic entity

Problem Entity Tracking: Adds frozen entities to problematicEntities set; EnemyScalingHandler skips these to prevent repeated deadlocks.


🔧 Chunk Loading Deadlock Fix

Affected Files:

  • EnemyScalingHandler.java
  • EnchantmentScalingHandler.java

Root Cause: AABB + getEntitiesOfClass() in EntityJoinLevelEvent / FinalizeSpawnEvent triggers chunk loading within range, deadlocking with ongoing world generation (especially with Cataclysm and similar structure mods).

Solution:

// ❌ Old code (triggers chunk loading)
AABB searchBox = new AABB(...);
List<<ServerPlayer> nearbyPlayers = serverLevel.getEntitiesOfClass(ServerPlayer.class, searchBox);

// ✅ New code (safe iteration, no chunk loading)
double rangeSq = range * range;
List<<ServerPlayer> nearbyPlayers = new ArrayList<>();
for (ServerPlayer player : serverLevel.getServer().getPlayerList().getPlayers()) {
    if (player.level() == serverLevel && player.distanceToSqr(mob) <= rangeSq) {
        nearbyPlayers.add(player);
    }
}

New Defenses:

  • SCALE_TIMEOUT_TAG — Auto-marks entity as problematic if scaling exceeds 30 seconds
  • Try-catch in onEntityJoinLevel() — Prevents third-party mod exceptions from crashing server
  • Watchdog integration — Updates status before/after entity processing

⚔️ Dynamic Weapon Damage Cap

Affected Files:

  • Config.java
  • EnchantmentScalingHandler.java

New Configs:

Config Default Description
weaponDamageBaseCap 12.0 Weapon damage cap at lowest difficulty (6 hearts)
weaponDamageCapPerDifficulty 3.0 Damage cap increase per difficulty multiplier
weaponDamageMaxCap 40.0 Absolute damage cap (20 hearts)

Formula:

Dynamic Cap = Base + (Difficulty Multiplier - 1.0) × Per-Difficulty Increment
Final Cap = min(Dynamic Cap, Absolute Cap)

Weapon Filtering Logic:

  1. Iterate weapons from current quality tier downward
  2. Calculate actual damage via getWeaponDamage() (includes attribute modifiers)
  3. Only select weapons within damage cap
  4. If all weapons exceed cap, fallback to wooden sword

Mod Weapon Filtering: Main-hand weapons in tryGetModEquipment() are checked against damage cap; overpowered weapons are filtered with debug logging.


💀 Boss Anti-HP-Explosion

Affected File: BossDamageCapHandler.java

Problem Scenario: EntityJoinLevelEvent may trigger multiple times:

  • Player teleports away, chunk unloads, returns and chunk reloads
  • Player switches dimensions, entity reloads
  • Server restarts, entity loads from disk

Without checks, Boss health multiplies by BOSS_HEALTH_MULTIPLIER on each reload, causing exponential explosion.

Solution:

New NBT Tag Purpose
BOSS_BUFF_APPLIED_TAG Marks Boss buff as applied, prevents repeated triggers
BOSS_ORIGINAL_HEALTH_TAG Stores original base health value
BOSS_ORIGINAL_DAMAGE_TAG Stores original base damage value

Attribute Calculation:

Final Health = Original Health × EnemyScaling Multiplier × Boss Multiplier
Final Damage = Original Damage × EnemyScaling Multiplier × Boss Multiplier

This ensures correct stacking regardless of EnemyScalingHandler and BossDamageCapHandler execution order.


🎯 Other Optimizations

EnchantmentScalingHandler.java:

  • Optimized humanoid mob detection using precise entity ID matching instead of string containment
  • New supported mob types: Bogged, Piglin, Piglin Brute, etc.

ModEventHandler.java:

  • Updates watchdog tick timestamp in ServerTickEvent.Post
  • Stops watchdog service in onServerStopping
  • Injects watchdog status before/after Boss processing

AdaptiveNemesisMod.java:

  • Starts watchdog service after config loading completes

gradle.properties:

  • Version bumped from 1.0.6 to 1.0.7

⚔️ As the Nemesis evolves, so do we ⚔️

GitHub

1.0.6Релиз1.21.1 · 7 июня 2026 г.



⚔️ Adaptive Nemesis v1.0.6 ⚔️

Every time you grow stronger, your Nemesis evolves


📋 TL;DR

Item Description
Impact Scope Medium — All UI messages across 10 command classes
Core Change Added English translations to all command output messages, bilingual display
Format Mixed Chinese/English and Chinese [English] formats

📝 Command Localization

Translation Format

Format Example Usage
Slash separator Status/Status: Enabled(已启用) Most messages
Bracket suffix This command can only be executed by players §7[此命令只能由玩家执行] Error messages
Mixed format Note/注意: Changes will take effect after restart §7[配置更改将在下次重启后生效] Warnings

Affected Commands

Command Messages Updated Special Handling
DifficultyCommand 12 Difficulty settings, true damage settings
HelpCommand 10 All help descriptions
MemoryCommand 10 Combat records, KDA statistics
ProtectionCommand 9 Newbie protection status
ReloadCommand 2 Reload notifications
ScanCommand 12 Scan results, attribute display, added English mapping switch
StatusCommand 10 Player status, config display
StrengthCommand 9 Strength details
SummonNemesisCommand 7 Summon messages, Nemesis names
TestCommand 50+ All test output messages

ScanCommand English Mapping

Added English translation mapping for scanned attributes:

String nameEn = switch (name) {
    case "血量/HP" -> "HP";
    case "攻击/Damage" -> "Damage";
    case "护甲/Armor" -> "Armor";
    case "攻速/Atk Speed" -> "Atk Speed";
    case "韧性/Toughness" -> "Toughness";
    default -> name;
};

🐛 Bug Fixes

None — This is a pure localization update with no functional changes.


⚔️ As the Nemesis evolves, so do we ⚔️

GitHub

1.0.5Релиз1.21.1 · 6 июня 2026 г.



⚔️ Adaptive Nemesis v1.0.5 ⚔️

Every time you grow stronger, your Nemesis evolves


✨ New Features

🚫 Entity Blacklist System

Wildcard support to exclude specific mobs, precise scaling control:

Config Type Default Description
entityFilter.entityBlacklist String "" Entity blacklist, supports * wildcard

Example config:

minecraft:iron_golem,alexsmobs:*,minecraft:wolf

Iron Golems, all Alex's Mobs, and Wolves will not be scaled


🛡️ Anti-HP-Explosion Mechanism

Fixes exponential attribute growth after soul stone capture (NBT reset):

Protection Layer Mechanism Fallback Order
NBT Marker Read saved original health 1
Default Attribute Query Get entity registration default via DefaultAttributes 2
Current Base Health Use current attribute value (fallback) 3

🧍 Humanoid Equipment Restriction

Prevents non-humanoid mobs from receiving gear, improves game logic:

Mob Type Gets Equipment Examples
Zombie types Zombie, Husk, Drowned
Skeleton types Skeleton, Wither Skeleton, Stray
Generic types Vindicator, Evoker, Pillager
Spider types Spider, Cave Spider
Creeper types Creeper
Animal types Cow, Pig, Sheep

🚫 Boss Identification Fix

Excludes Animal subclasses, prevents high-HP animals from being misidentified as Bosses:

if (entity instanceof Animal) {
    return false;  // Animals are not Bosses
}

🐛 Bug Fixes

Fix Description
Iron Golem misidentification High-HP Iron Golems no longer identified as Bosses
Animal misidentification High-HP animals no longer identified as Bosses
Soul stone explosion Captured scaled mobs no longer have exponential HP growth
Spider with sword Spiders, Creepers and other non-humanoids no longer get equipment

⚔️ As the Nemesis evolves, so do we ⚔️

GitHub

1.0.4Релиз1.21.1 · 30 мая 2026 г.



⚔️ Adaptive Nemesis v1.0.4 ⚔️

Every time you grow stronger, your Nemesis evolves


✨ New Features

🎯 Boss Identification System Refactor

Adopted Strategy Pattern + Chain of Responsibility for unified Boss identification logic:

Strategy Priority Description
Type-Based 1 instanceof check for vanilla Bosses
Name-Based 2 Keyword matching for modded Bosses
Health Threshold 3 Auto-identify when MaxHealth ≥ 200

New configs: bossIdentificationKeywords, bossHealthThreshold


🛡️ Dangerous Enchantment Protection

Added dangerous enchantment detection to prevent mobs from obtaining game-breaking enchants:

Detection Keywords Examples
English immune, invulnerable, god, divine_protection
Chinese 免伤, 无敌, 免疫

Auto-skips dangerous enchants, logs WARN message


🤝 Mod Compatibility Enhancement

L2Hostility Compatibility

Config Effect
modCompatL2HostilityEnabled Skips health/speed scaling to prevent HP explosion from ADD_MULTIPLIED_TOTAL mechanic

Epic Fight & Iron's Spells NaN/Infinity Protection

Protection Description
safeSetAttribute() Prevents NaN/Infinity attribute value propagation
safeDouble() Falls back to safe defaults on abnormal values

💎 Soul Stone Marker System

Solves duplicate scaling after soul stone capture/release:

Marker Method Persistence Purpose
NBT Marker ❌ Cleared by soul stone Standard detection path
LUCK Attribute Marker ✅ Retained by soul stone Secondary detection path

Uses characteristic value 0.0420 as cross-NBT clearing marker


📝 Debug Log File

Fixed config shell issue, implemented complete log file output:

[debug]
debugLogToFile = true
debugLogFilePath = "logs/adaptive_nemesis_debug.log"

🐛 Bug Fixes

Fix Description
Mob State Validation Clears Invulnerable flag, fixes invalid health/attack/armor attributes
Config Screen Update Added "Mod Compatibility" category with 4 toggleable switches
Localization Added Added EN/ZH translations for 6 new config options

⚙️ New Config Options

Config Key Type Default Description
bossIdentificationKeywords String boss,dragon,wither,warden Boss identification keywords
bossHealthThreshold Double 200.0 Boss health identification threshold
modCompatL2HostilityEnabled Boolean true L2Hostility compatibility
modCompatEpicFightEnabled Boolean true Epic Fight compatibility
modCompatIronsSpellsEnabled Boolean true Iron's Spells compatibility
modCompatApotheosisEnabled Boolean true Apotheosis compatibility

⚔️ As the Nemesis evolves, so do we ⚔️

GitHub

1.0.3hotfixРелиз1.21.1 · 23 мая 2026 г.

⚔️ Adaptive Nemesis KubeJS Architecture Refactor ⚔️

Optional dependency, safe isolation

📋 TL;DR

Item Description
Impact Scope High — Refactored KubeJS integration architecture, resolved optional dependency class loading conflicts
Core Solution Reflection isolation + ServiceLoader auto-discovery

🔧 Before & After

Before: Direct Dependency (High Risk)

AdaptiveNemesisKubeJSPlugin implements KubeJSPlugin
↓ Direct reference
EventGroup / EventHandler / KubeJS API
↓ Class loading crash (when KubeJS not installed)
ClassNotFoundException

After: Reflection Isolation (Safe)

AdaptiveNemesisKubeJSPlugin (Plain bridge class)
↓ Reflection check
KubeJSInitializer implements KubeJSPlugin
↓ Direct reference
EventGroup / EventHandler / KubeJS API
↓ ServiceLoader auto-loading

⚔️ As the Nemesis evolves, so does the architecture ⚔️

GitHub

Комментарии

Загружаем…