Skip to content

Examples

U_Love edited this page Jul 25, 2026 · 1 revision

Adaptive Nemesis: Examples

This page collects ready-to-use data packs and KubeJS scripts that demonstrate the extension features documented in this wiki.


Data Pack Examples

All data pack examples are located under src/main/resources/examples/datapack/data/adaptive_nemesis/.

Invasions

File Description
invasions/undead_invasion.json 6-wave undead invasion with progressively harder waves and dungeon/shipwreck rewards
invasions/nether_invasion.json 5-wave Nether invasion ending with a Wither boss and Nether fortress/bastion rewards

World Stages

File Description
world_stages/stage_2.json Stage 2 configuration with 2.0x multiplier and higher caps
world_stages/stage_3.json Stage 3 configuration with 3.0x multiplier and increased invasion wave count

Nemesis

File Description
nemesis/custom_nemesis.json Custom nemesis formula with higher resistance/bonus caps and faster leveling

How to Use

  1. Copy the desired folder(s) into your own data pack under data/<your_namespace>/.
  2. Adjust values to match your modpack balance.
  3. Run /reload in-game.
  4. Trigger an invasion with /an invasion trigger adaptive_nemesis:undead_invasion.

KubeJS Script Examples

All script examples are located under kubejs_example/server_scripts/adaptive_nemesis/.

File Covered Events / Features
entity_scaling.js entity_scale, player_strength_evaluation, damage_calculation, nemesis_memory_update
custom_difficulty.js Custom global difficulty system with /an_difficulty command
world_stage_change.js world_stage_change event: broadcasts, multiplier tweaks, stage rewards
invasion_events.js invasion_start, invasion_wave_start, invasion_end event chain
advanced_helpers.js Calling KubeJSInitializer helpers via Java.loadClass

How to Use

  1. Copy the desired .js files into your modpack's kubejs/server_scripts/ directory.
  2. Restart the server or run /kubejs reload.
  3. Check the server console for the "loaded" log message.

Quick Start

Data Pack Quick Start

Create data/adaptive_nemesis/invasions/my_invasion.json:

{
  "max_waves": 3,
  "spawn_distance": 50,
  "rewards": {
    "experience": 100
  },
  "waves": [
    {
      "wave": 1,
      "difficulty_multiplier": 1.0,
      "enemies": [
        {"entity_type": "minecraft:zombie", "count": 3, "weight": 1}
      ]
    }
  ]
}

Trigger it with:

/an invasion trigger adaptive_nemesis:my_invasion

KubeJS Quick Start

Create kubejs/server_scripts/my_adaptive_script.js:

adaptive_nemesis.entity_scale(event => {
    if (event.entityId.includes("zombie")) {
        event.multiplyMultiplier(1.5);
    }
});

Run /kubejs reload. All zombies will now receive an extra 50% scaling.


See Also

  • Datapack — full data pack field reference
  • KubeJS — full event API reference

Clone this wiki locally