mojira.dev
MC-307688

Spawner blocks with custom spawn rules can't spawn hoglins, piglins, or sulfur cubes in peaceful

The bug

Some monsters are allowed to exist in peaceful mode; namely, hoglins, piglins, and sulfur cubes. They can be spawned with spawn eggs or spawner blocks, and as of 26.2 snapshot 4, they can even spawn naturally.

However, if a spawner block declares custom_spawn_rules, these mobs cannot spawn in peaceful mode.

How to reproduce

  1. /difficulty peaceful

  2. /setblock ~ ~ ~ spawner{SpawnData:{entity:{id:"hoglin"}},MaxSpawnDelay:0s,MinSpawnDelay:0s}
    -> ✔ It immediately spawns hoglins

  3. Fly somewhere else

  4. /setblock ~ ~ ~ spawner{SpawnData:{entity:{id:"hoglin"},custom_spawn_rules:{}},MaxSpawnDelay:0s,MinSpawnDelay:0s}
    -> ❌ No hoglins ever spawn

Expected result

Hoglins should spawn from spawner blocks in peaceful mode even when custom_spawn_rules is specified

Observed result

The spawner only works if custom_spawn_rules is not present

Comments 2

With the /setblock ~ ~ ~ spawner{SpawnData:{entity:{id:"mob"}},MaxSpawnDelay:0s,MinSpawnDelay:0s}command, piglins always fail to spawn, no matter the difficulty.

I forgot about light level requirements lol

tryashtar

(Unassigned)

Unconfirmed

(Unassigned)

26.2 Snapshot 4

Retrieved