mojira.dev
MC-276451

Monster natural spawning problem with custom light levels

Monsters don't spawn in proper light levels when changing them via a datapack.

How to reproduce:

  • Create a datapack and alter the "dimension_type" (for example: "overworld.json") to the following values:

...
"monster_spawn_block_light_limit": 15,
"monster_spawn_light_level": {
    "type": "minecraft:uniform",
    "max_inclusive": 15,
    "min_inclusive": 10
},
...
  • Load into the game and set up a lit area with light level 10+ under the sky.

Result: monsters don't spawn in that lit area

Note: the monsters will still spawn in light levels below 7 or lower if the area isn't under the sky.

Attachments

Comments 3

If you have created a data pack, please attach it to the report.

Datapack has been attached.

The only file in it is located in "data/minecraft/dimension_type/overworld.json":

{
  "ambient_light": 0.0,
  "bed_works": true,
  "coordinate_scale": 1.0,
  "effects": "minecraft:overworld",
  "has_ceiling": false,
  "has_raids": true,
  "has_skylight": true,
  "height": 384,
  "infiniburn": "#minecraft:infiniburn_overworld",
  "logical_height": 384,
  "min_y": -64,
  "monster_spawn_block_light_limit": 15,
  "monster_spawn_light_level": {
    "type": "minecraft:uniform",
    "max_inclusive": 15,
    "min_inclusive": 10
  },
  "natural": true,
  "piglin_safe": false,
  "respawn_anchor_works": false,
  "ultrawarm": false
}

Can confirm using the data pack.

DMan16

(Unassigned)

Community Consensus

Platform

Important

Data Packs, Mob spawning

1.21.1

Retrieved