Skip to content

2.3.x Mob Spawner Modifications

Wufflez edited this page Nov 8, 2025 · 1 revision

Dungeon Crawl also has the ability to modify the type of mobs that can spawn from spawners in a dungeon. The configurations are per-level, and require the understanding of how to make a datapack.

Configuring Per-Level Mob Spawners

In your datapack, modifying per-level mob spawners can be found at data/dungeoncrawl/monster.

< Name of Datapack >
├-- pack.mcmeta
└-- data
    └-- dungeoncrawl
        └-- monster
            ├-- entities
            └-- equipment
            |   ├-- armor
            |   └-- weapon
            ├-- potion_effects
            └-- spawn_rates.json

The entities directory configures which entity types have a chance to spawn from a spawner. The equipment directory modifies what kind of armor and weapons the mobs can spawn with, found within armor and weapon respectively. The potion_effects directory modifies what potion effects a mob has a chance of spawning with. Lastly, the spawn_rates.json file determines the miximum and maximum spawn delay and entity count per level for the spawners.

Keep in mind, all of these settings will be applied to every dungeon in your world, and not a specific dungeon!

Entities

In the entities directory, it is divided up into five file, one for each stage(dungeon layer):

...
├-- entities
|   ├-- stage_1.json
|   ├-- stage_2.json
|   ├-- stage_3.json
|   ├-- stage_4.json
|   └-- stage_5.json
...

And in each file, the entity types are divided into two parts, common and rare, with the difference being that rare mobs have a 1 in 10 chance of spawning. Should the randomizer fail to spawn a rare mob, or the mob is invalid, it will deffer to a common mob to spawn.

Here is an example entry for a dungeon layer with a few mobs:

{
  "common": [
    {
      "entity": "minecraft:zombie"
    }
  ],
  "rare": [
    {
      "entity": "minecraft:creeper"
    }
  ]
}

In this example, the dungeon layer will either spawn a zombie, or a creeper in a mob spawner, where the creeper has a 1 in 10 chance. Additionally, multiple mobs can be added in each list to adjust the diversity of entity types to spawn.

{
  "common": [
    {
      "entity": "minecraft:zombie"
    },
    {
      "entity": "minecraft:skeleton"
    }
  ]
}

Furthermore, weight can be added to each entry to adjust the likelyhood that it will spawn in a spawner for that rarity.

{
  "common": [
    {
      "entity": "minecraft:zombie",
      "weight": 7
    },
    {
      "entity": "minecraft:skeleton"
    }
  ]
}

The weight value is optional, and if left out, defaults the entry's weight to 1.

Sidenote: Passive mobs can work in this configuration as well, however, their spawning conditions still might be limited to how that mob would normally spawn. If you're having issues spawning a certain mob, please refer to that mod's spawning conditions for said mob.

An example of the default configuration can be found here.

Equipment

Just like the Entities section, each part is divided up into five files, one for each layer. These files are found under the armor and weapon directories, for armor that the mobs wear and the weapons they hold respectively.

...
├-- equipment
|   ├-- armor
|   |   ├-- stage_1.json
|   |   ├-- stage_2.json
|   |   ├-- stage_3.json
|   |   ├-- stage_4.json
|   |   └-- stage_5.json
|   └-- weapon
|   |   ├-- stage_1.json
|   |   ├-- stage_2.json
|   |   ├-- stage_3.json
|   |   ├-- stage_4.json
|   |   └-- stage_5.json
...

Each armor has a chance to be equipped by a mob, which that chance increasing as you go further down in the dungeon layers. The equation for equipping armor is as follows:

$$chance=0.4+(0.15\times layer)$$

Where layer is the current layer of the dungeon and can be no greater than 4.

In each file, the armor section is divided into four parts: helmet, chestplate, leggings, and boots, each referring to the equipment slot they would go to.

In the weapon section, it gets two: melee and ranged.

Here is an example of an armor entry:

{
    "helmet": [
        {
            "item": "minecraft:leather_helmet"
        }
    ]
}

This configures the dungeon layer to have a chance of spawning a leather helmet on a mob.

Additionally, a weight can be applied to each armor for further configuration:

{
    "helmet": [
        {
            "item": "minecraft:leather_helmet",
            "weight": 5
        },
        {
            "item": "minecraft:iron_helmet"
        }
    ]
}

An example of a weapon entry:

{
    "melee": [
        {
            "item": "minecraft:wooden_sword",
            "weight": 2
        }
    ]
}

An example of a defalt armor configuration can be found here, and a weapon one here.

Potion Effects

Similar to the previous two sections, the potion_effects directory comes with five files, each one for each layer.

...
├-- potion_effects
|   ├-- stage_1.json
|   ├-- stage_2.json
|   ├-- stage_3.json
|   ├-- stage_4.json
|   └-- stage_5.json
...

The potion files come in two parts: rolls and effects, with an optional guaranteed part.

At the beginning of the file, there's a part for chance and rolls.

  • chance - The percentage that an effect will be rolled, represented by a float between 0.0 and 1.0
  • rolls - The minimum and maximum number of times it will roll an effect it it succeeds the chance

The top of your file should look something like this:

{
    "chance": 0.15,
    "rolls": {
        "min": 1,
        "max": 5
    }
}

Next, the optional guaranteed section. Any potion effect listed in here, regardless of the chance, will always be applied to a mob.

{
    "guaranteed": [
        {
            "effect": "minecraft:absorption",
            "duration": 12000
        }
    ]
}

Lastly, the effects section. When the chance succeeds, a random number of potion effects from this list will be applied, that number determined by the min and max rolls.

{
    "effects": [
        {
            "effect": "minecraft:resistance",
            "duration": 3000,
            "amplifier": {
                "min": 2,
                "max": 2
            }
        },
        {
            "effect": "minecraft:night_vision",
            "duration": 9000,
            "amplifier": {
                "min": 1,
                "max": 1
            }
        }
    ]
}

Additionally, weight can be added to increase the chance that a specific effect will be chosen.

{
    "effects": [
        {
            "effect": "minecraft:resistance",
            "duration": 3000,
            "amplifier": {
                "min": 2,
                "max": 2
            },
            "weight": 4
        },
        {
            "effect": "minecraft:night_vision",
            "duration": 9000,
            "amplifier": {
                "min": 1,
                "max": 1
            }
        }
    ]
}

Spawn Rates

In this file, you can configure the minimum and maximum spawn delay for each layer's spawner, as well as the spawn count. Here is an example of a single layer:

{
    "level_1": {
        "delay": {
            "min": 100,
            "max": 300
        },
        "amount": {
            "min": 2,
            "max": 6
        }
    }
}

See this file for an example. All five layers are required.

Clone this wiki locally