mojira.dev
MC-307449

Spawners with their light limits set no longer spawn mobs underground at night time

Due to bugfix MC-264187 spawners can no longer spawn mobs at night time when placed underground (or just simply anywhere that skylight doesn’t reach). Since spawners now take the darkness of the sky into account, this calculated skylight value can end up below zero if the area the spawner is in had 0 skylight to begin with.

This in turn fails the range check between 0 and 15 if the provided value is for example -11, causing the mob not to spawn.

Reproduction steps

  1. Create a flat world.

  2. Prevent mobs from spawning naturally: /gamerule spawn_monsters false

  3. Create a simple spawner using custom spawn rules:

    /setblock ~ ~ ~ spawner{SpawnData:{entity:{id:"minecraft:skeleton"},custom_spawn_rules:{block_light_limit:[0,15],sky_light_limit:[0,15]}}}
  4. Fly up above the spawner and create a roof, preventing skylight from reaching the spawner: /fill ~-20 ~ ~-20 ~20 ~ ~20 tinted_glass

  5. Set the time to night: /time set midnight

The spawner is unable to spawn mobs in this condition. Now remove a block in the roof above the spawner or let it become daytime and it will immediately start spawning mobs again.

Comments 0

No comments.

Wesley1808

(Unassigned)

Confirmed

(Unassigned)

26.1.2

Retrieved