Skip to content

Spawn Rules

Spawn rule files live in plugins/EmakiMobs/spawn_rules/*.yml. Each file can contain multiple rules under a rules: list.

File structure

yaml
rules:
  - mob_id: <mob id>
    type: <spawn type>
    # type-specific fields…

The loader accepts only two type values

The "Six spawn types" section below is outdated

The current loader only recognises type: natural and type: autonomous. Writing structure, biome, player_relative, day_interval or custom does not raise an error — it is logged as Unknown spawn type and the whole rule is skipped silently.

In the six-type sections below, everything except natural describes the old schema. The field descriptions are still useful as a reference, but the type values themselves no longer work. See autonomous — self-scheduled spawning for the current equivalents. The bundled spawn_rules/overworld.yml annotates each old type with its migration path.

Old typeCurrent equivalentMigration notes
structureautonomous + trigger: intervalinterval_ticks moves up to the rule root; active_spawn and require_player_nearby are not current fields.
biomeautonomous + trigger: intervalbiomes, interval_ticks and distance carry over; conditions.light_max / conditions.require_surface become root-level light_level_max / require_surface.
player_relativeautonomous + trigger: player_followdistance, max_global, interval_ticks and count carry over; require_sky_access is not a current field.
day_intervalautonomous + trigger: day_intervalinterval_days, on_day_start, max_global and count carry over; distance_from_player becomes distance.
customautonomous + trigger: intervalinterval_ticks, distance, biomes, max_nearby and count carry over.

autonomous — self-scheduled spawning

Runs entirely outside vanilla spawn events, driven by its own scheduler. trigger selects the scheduling mode. If trigger is missing or unknown, the whole rule is skipped.

yaml
- mob_id: elite_zombie
  type: autonomous
  trigger: interval
  interval_ticks: 1200
  worlds:
    - world
  biomes:
    - plains
  distance:
    min: 16
    max: 64
  max_nearby: 4
  max_global: 10
  count:
    min: 1
    max: 2

The four triggers

triggerSchedulingKey fields
intervalFixed tick interval, scans every online playerinterval_ticks
player_followFixed tick interval, picks one random online player each timeinterval_ticks
day_intervalCounts in-game daysinterval_days, on_day_start
cronFires on real system time via a Cron expressioncron

trigger values are case-insensitive. cron uses the 6-field Quartz format (second minute hour day-of-month month day-of-week); a blank or unparsable expression is logged as a warning and the rule never fires.

Fields

FieldTypeDefaultDescription
triggerstringnone (required)Scheduling mode, see the table above.
interval_tickslong600Spawn interval for interval / player_follow (ticks).
interval_daysint1In-game day interval for day_interval.
on_day_startbooleanfalsetrue = fire at sunrise; false = fire as soon as the counter is reached.
cronstring""Cron expression for trigger: cron.
worldsstring list[] (any)Restrict to these world names.
biomesstring list[] (any)Restrict to these biomes.
structuresstring list[] (any)Restrict to vanilla structures, in NamespacedKey format.
y_rangeint list [min, max][-64, 320]Valid Y range.
light_level_maxint15Only spawn where the light level is at or below this value.
time_of_daystringanyany / day (in-game time 1000–12999) / night (13000–999). Unknown values behave like any.
require_surfacebooleanfalseRequire full sky light at the spawn position.
distance{min, max}{16, 64}Spawn distance from the player (blocks).
max_nearbyint0Max same-id mobs within 64 blocks; 0 = unlimited.
max_globalint0Global cap on same-id mobs across all worlds; 0 = unlimited.
count{min, max}{1, 1}Number of mobs to spawn per trigger.
conditionsectionnoneOptional condition block.

Six spawn types

natural — intercept vanilla spawn event

Intercepts Minecraft's CreatureSpawnEvent and replaces naturally spawning mobs with a custom mob when conditions are met.

FieldTypeDefaultDescription
worldsstring list[] (any)Restrict to these world names.
biomesstring list[] (any)Biomes where replacement is attempted.
y_rangeint list [min, max][-64, 320]Valid Y coordinate range.
light_level_maxint15Max light level (inclusive) that allows replacement.
replacement_chancedouble1.0Probability to replace the vanilla mob.
max_nearbyint0Max same-id mobs within 64 blocks; 0 = unlimited.
count{min, max}{1, 1}Number of mobs to spawn per trigger.
conditionsectionnoneOptional condition block.
yaml
- mob_id: elite_zombie
  type: natural
  biomes: [plains, forest]
  y_range: [-64, 50]
  light_level_max: 7
  replacement_chance: 0.08
  max_nearby: 3
  count: { min: 1, max: 1 }

structure — timed spawn inside structures

Periodically spawns mobs inside vanilla structures when a player is nearby.

FieldTypeDefaultDescription
structuresstring list[]Target structure NamespacedKeys.
max_nearbyint0Max same-id mobs near the structure.
active_spawn.interval_ticksint1200Spawn check interval (ticks).
active_spawn.require_player_nearbyint64Player proximity required to trigger.
yaml
- mob_id: bone_lord
  type: structure
  structures: [minecraft:stronghold]
  max_nearby: 1
  active_spawn:
    interval_ticks: 6000
    require_player_nearby: 64
  count: { min: 1, max: 1 }

biome — periodic biome-filtered spawn

Every interval_ticks, searches for a surface position near each online player. Spawns if the position is in one of the listed biomes and meets conditions.

FieldTypeDefaultDescription
biomesstring list[] (any)Target biomes.
interval_tickslong400Check interval per player (ticks).
distance{min, max}{16, 64}Spawn distance from player (blocks).
conditions.light_maxint15Max light level at spawn position.
conditions.require_surfacebooleanfalseRequire sky access at spawn position.
max_nearbyint0Max same-id mobs nearby.
yaml
- mob_id: jungle_stalker
  type: biome
  biomes: [jungle, bamboo_jungle]
  interval_ticks: 600
  distance: { min: 16, max: 48 }
  conditions:
    light_max: 7
    require_surface: false
  max_nearby: 2
  count: { min: 1, max: 2 }

player_relative — follow-player timed spawn

Every interval_ticks, spawns at a random position near each online player. Suitable for rare escort-style mobs.

FieldTypeDefaultDescription
distance{min, max}{16, 64}Spawn distance from player (blocks).
require_sky_accessbooleanfalseRequire sky access at spawn position.
max_globalint0Global cap on this mob type; 0 = unlimited.
interval_tickslong24000Spawn interval per player (ticks).

day_interval — real in-game day timer

Triggers every interval_days in-game days (~20 min/day). Suitable for periodic boss events.

FieldTypeDefaultDescription
interval_daysint1Trigger every N in-game days.
on_day_startbooleanfalsetrue = trigger at sunrise; false = trigger when counter reaches zero.
distance_from_player{min, max}{16, 64}Spawn distance from player (blocks).
max_globalint0Global cap on this mob type.

custom — flexible timed spawn

Most flexible type. Periodically spawns near each player, with an optional biome filter.

FieldTypeDefaultDescription
interval_tickslong600Spawn interval per player (ticks).
distance{min, max}{16, 64}Spawn distance from player (blocks).
biomesstring list[] (any)Optional biome filter.
max_nearbyint0Max same-id mobs nearby.