Skip to content

spawner_randomizing_processor

finnsetchell edited this page Aug 15, 2026 · 1 revision

spawner_randomizing_processor

Sets a mob spawner's mob from a weighted list at generation time, along with the usual spawner timing values. Use it when you want one spawner NBT to produce varied mobs across placements instead of baking a fixed mob into every copy of the piece.

Adapted from RepurposedStructures (TelepathicGrunt), with the mob list taken inline in the codec rather than through a separate manager.

Minimal example

From MMR's desert mineshaft spawners:

{
  "processor_type": "moogs_structures:spawner_randomizing_processor",
  "weighted_entities": [
    { "entity": "minecraft:husk",       "weight": 4 },
    { "entity": "minecraft:zombie",     "weight": 2 },
    { "entity": "minecraft:cave_spider", "weight": 2 }
  ],
  "min_spawn_delay": 300,
  "max_spawn_delay": 900,
  "spawn_count": 2,
  "max_nearby_entities": 4,
  "required_player_range": 14,
  "spawn_range": 4
}

Fields

Field Type Required Default Notes
weighted_entities array yes The mob pool. See below.
delay int no 20 Ticks before the first spawn.
min_spawn_delay int no 200
max_spawn_delay int no 800
spawn_count int no 4
max_nearby_entities int no 6
required_player_range int no 16
spawn_range int no 4
spawner_replacement_block block-state no minecraft:air Only used when weighted_entities is empty. See gotchas.

weighted_entities

Field Type Required Notes
entity entity id yes Must resolve in the entity registry.
weight int yes 1 or higher. Relative, not a percentage.
nbt object no Extra tags merged into the spawned entity, for pre-equipped or pre-configured mobs.

Weights are relative to their sum, so [4, 2, 2] and [40, 20, 20] behave the same. The roll is seeded from the spawner's position, so a given spawner in a given placement always picks the same mob, while separate spawners in one piece roll independently.

Gotchas

  • Timing values are written as shorts. The codec accepts anything up to 2147483647, but values above 32767 wrap negative and produce a broken spawner. Keep them under 32767.
  • spawner_replacement_block is not a fallback. It only applies when weighted_entities is an empty array, in which case every spawner in the piece is replaced by that block. With the default, that deletes the spawner. It never fires when the list has entries.
  • nbt cannot override the mob. An id key inside nbt is overwritten by the entry's entity field.
  • Optional fields fail quietly. A typo in any field other than weighted_entities (wrong type, out of range) is swallowed and the default is used, with nothing logged. Errors inside weighted_entities are hard failures instead.
  • Trial spawners are a different block and are not touched here. Use trial_spawner_randomizing_processor.

See also

Clone this wiki locally