Spawn Rules
Spawn rule files live in plugins/EmakiMobs/spawn_rules/*.yml. Each file can contain multiple rules under a rules: list.
File structure
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 type | Current equivalent | Migration notes |
|---|---|---|
structure | autonomous + trigger: interval | interval_ticks moves up to the rule root; active_spawn and require_player_nearby are not current fields. |
biome | autonomous + trigger: interval | biomes, interval_ticks and distance carry over; conditions.light_max / conditions.require_surface become root-level light_level_max / require_surface. |
player_relative | autonomous + trigger: player_follow | distance, max_global, interval_ticks and count carry over; require_sky_access is not a current field. |
day_interval | autonomous + trigger: day_interval | interval_days, on_day_start, max_global and count carry over; distance_from_player becomes distance. |
custom | autonomous + trigger: interval | interval_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.
- 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: 2The four triggers
trigger | Scheduling | Key fields |
|---|---|---|
interval | Fixed tick interval, scans every online player | interval_ticks |
player_follow | Fixed tick interval, picks one random online player each time | interval_ticks |
day_interval | Counts in-game days | interval_days, on_day_start |
cron | Fires on real system time via a Cron expression | cron |
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
| Field | Type | Default | Description |
|---|---|---|---|
trigger | string | none (required) | Scheduling mode, see the table above. |
interval_ticks | long | 600 | Spawn interval for interval / player_follow (ticks). |
interval_days | int | 1 | In-game day interval for day_interval. |
on_day_start | boolean | false | true = fire at sunrise; false = fire as soon as the counter is reached. |
cron | string | "" | Cron expression for trigger: cron. |
worlds | string list | [] (any) | Restrict to these world names. |
biomes | string list | [] (any) | Restrict to these biomes. |
structures | string list | [] (any) | Restrict to vanilla structures, in NamespacedKey format. |
y_range | int list [min, max] | [-64, 320] | Valid Y range. |
light_level_max | int | 15 | Only spawn where the light level is at or below this value. |
time_of_day | string | any | any / day (in-game time 1000–12999) / night (13000–999). Unknown values behave like any. |
require_surface | boolean | false | Require full sky light at the spawn position. |
distance | {min, max} | {16, 64} | Spawn distance from the player (blocks). |
max_nearby | int | 0 | Max same-id mobs within 64 blocks; 0 = unlimited. |
max_global | int | 0 | Global cap on same-id mobs across all worlds; 0 = unlimited. |
count | {min, max} | {1, 1} | Number of mobs to spawn per trigger. |
condition | section | none | Optional 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.
| Field | Type | Default | Description |
|---|---|---|---|
worlds | string list | [] (any) | Restrict to these world names. |
biomes | string list | [] (any) | Biomes where replacement is attempted. |
y_range | int list [min, max] | [-64, 320] | Valid Y coordinate range. |
light_level_max | int | 15 | Max light level (inclusive) that allows replacement. |
replacement_chance | double | 1.0 | Probability to replace the vanilla mob. |
max_nearby | int | 0 | Max same-id mobs within 64 blocks; 0 = unlimited. |
count | {min, max} | {1, 1} | Number of mobs to spawn per trigger. |
condition | section | none | Optional condition block. |
- 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.
| Field | Type | Default | Description |
|---|---|---|---|
structures | string list | [] | Target structure NamespacedKeys. |
max_nearby | int | 0 | Max same-id mobs near the structure. |
active_spawn.interval_ticks | int | 1200 | Spawn check interval (ticks). |
active_spawn.require_player_nearby | int | 64 | Player proximity required to trigger. |
- 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.
| Field | Type | Default | Description |
|---|---|---|---|
biomes | string list | [] (any) | Target biomes. |
interval_ticks | long | 400 | Check interval per player (ticks). |
distance | {min, max} | {16, 64} | Spawn distance from player (blocks). |
conditions.light_max | int | 15 | Max light level at spawn position. |
conditions.require_surface | boolean | false | Require sky access at spawn position. |
max_nearby | int | 0 | Max same-id mobs nearby. |
- 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.
| Field | Type | Default | Description |
|---|---|---|---|
distance | {min, max} | {16, 64} | Spawn distance from player (blocks). |
require_sky_access | boolean | false | Require sky access at spawn position. |
max_global | int | 0 | Global cap on this mob type; 0 = unlimited. |
interval_ticks | long | 24000 | Spawn 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.
| Field | Type | Default | Description |
|---|---|---|---|
interval_days | int | 1 | Trigger every N in-game days. |
on_day_start | boolean | false | true = trigger at sunrise; false = trigger when counter reaches zero. |
distance_from_player | {min, max} | {16, 64} | Spawn distance from player (blocks). |
max_global | int | 0 | Global cap on this mob type. |
custom — flexible timed spawn
Most flexible type. Periodically spawns near each player, with an optional biome filter.
| Field | Type | Default | Description |
|---|---|---|---|
interval_ticks | long | 600 | Spawn interval per player (ticks). |
distance | {min, max} | {16, 64} | Spawn distance from player (blocks). |
biomes | string list | [] (any) | Optional biome filter. |
max_nearby | int | 0 | Max same-id mobs nearby. |