-
Notifications
You must be signed in to change notification settings - Fork 0
Natural Spawning
PlayerMobs can spawn in the wild as part of normal world generation and mob
spawning — no spawn egg or /summon required. It's opt-in and off by default,
configured entirely from config/playermob.properties and tunable live with the
/playermob naturalspawn commands. No Java, no datapack.
Added in v0.51.0. Earlier versions had no natural spawning — PlayerMobs only appeared via spawn egg,
/summon, or the Dungeon-Train event path.
When a mob spawns naturally, PlayerMob rolls that mob's configured chance; on a
hit it spawns a PlayerMob beside it. The original mob is never removed — a hit
just adds one extra PlayerMob. So naturalSpawnScale.minecraft:cow=0.15 means "~15%
of naturally-spawning cows also bring a PlayerMob along."
This applies to:
- Natural spawns — the per-tick spawn cycle (e.g. night-time hostiles).
- Chunk-generation spawns — the initial mobs/herds placed when terrain generates.
- Mob spawners — dungeon/structure spawner blocks.
- Villages — villagers (and structure-placed iron golems) are settled with PlayerMob companions at generation.
Edit config/playermob.properties (created on first run, in the server/world config
directory) and set:
naturalSpawnEnabled=trueThe config is read once at startup, so a file edit needs a server/client restart. To change things without a restart, use the commands below — they take effect immediately for the session.
Every supported mob belongs to a group, and each group has a default chance. The
generated config writes one naturalSpawnScale.<id> line per mob at its group default,
which you can edit individually.
| Group | Default | Members |
|---|---|---|
| Hostile | 0.0 |
zombie, zombie_villager, husk, drowned, skeleton, stray, bogged, creeper, spider, cave_spider, witch, slime, enderman, endermite, silverfish, phantom, pillager, vindicator, evoker, ravager, guardian |
| Nether | 0.05 |
blaze, ghast, magma_cube, wither_skeleton, piglin, piglin_brute, hoglin, zombified_piglin, strider |
| Animals | 0.15 |
cow, mooshroom, pig, sheep, chicken, rabbit, horse, donkey, llama, goat, frog, turtle, panda, polar_bear |
| Friendly | 0.15 |
wolf, fox, ocelot, parrot, bat, bee |
| Water | 0.0 |
squid, glow_squid, dolphin, axolotl, cod, salmon, pufferfish, tropical_fish |
| Villager | 0.25 |
villager, iron_golem |
Hostiles and water mobs default to 0 (off) — a player-shaped pillager underwater or replacing the whole night's mob budget is rarely wanted out of the box. Raise their group (or individual lines) to enable them.
- Natural spawning off →
0(nothing spawns). - An explicit
naturalSpawnScale.<id>line (or a command override) → that value. - Otherwise → the mob's group default.
- A mob in no group →
0.
All values are clamped to 0.0–1.0.
# Master switch (ships off)
naturalSpawnEnabled=true
# Per-mob lines are generated grouped, each at its group default:
# --- Hostile (0.0) ---
naturalSpawnScale.minecraft:zombie=0.0
# --- Animals (0.15) ---
naturalSpawnScale.minecraft:cow=0.15
# --- Villager (0.25) ---
naturalSpawnScale.minecraft:villager=0.25
naturalSpawnScale.minecraft:iron_golem=0.25Edit any line to override that mob. Delete a line to fall back to its group default.
All under /playermob naturalspawn, op level 2 (gamemasters). These are
session overrides — they take effect immediately, but are not written back to
the config file (a restart reverts to the file).
| Command | Effect |
|---|---|
/playermob naturalspawn |
Report the master switch + every group's default. |
/playermob naturalspawn on | off
|
Flip the master switch. |
/playermob naturalspawn <mob> on |
Set one mob to its group default. |
/playermob naturalspawn <mob> off |
Set one mob to 0 (never). |
/playermob naturalspawn <mob> <chance> |
Set one mob to an explicit 0.0–1.0. |
/playermob naturalspawn group <group> on |
Set every mob in the group to the group default. |
/playermob naturalspawn group <group> off |
Set every mob in the group to 0. |
/playermob naturalspawn group <group> <chance> |
Set every mob in the group to an explicit 0.0–1.0. |
<mob> is an entity id (tab-completes the supported list, e.g. minecraft:zombie).
<group> is one of hostile, nether, animals, friendly, water, villager.
# Turn it on and make every hostile bring a PlayerMob
/playermob naturalspawn on
/playermob naturalspawn group hostile 1.0
# But never from creepers specifically
/playermob naturalspawn minecraft:creeper off
# Halve the village companion rate
/playermob naturalspawn group villager 0.125Setting a per-mob or group chance while the master switch is off is allowed and remembered, but won't take effect until
/playermob naturalspawn on. The command tells you when that's the case.
- Additive, not a spawn-cap change. Companions are extra entities placed next to the rolled mob; they don't change vanilla spawn caps or where mobs spawn.
- The companion is a normal PlayerMob — it rolls its own skin, personality, and gear (a fresh natural roll; it isn't an "echo" reincarnation).
-
Village iron golems spawned by the village population mechanic (over time, as
villager count grows) use the
MOB_SUMMONEDreason and are not covered — only iron golems placed as part of structure generation are. - Thread-safe at world-gen. Chunk-generation and village placement run on a worldgen worker thread; the companion roll/spawn uses that context's RNG, so it's safe.
- Mob ids not present in your Minecraft version (e.g.
boggedbefore 1.21) simply never match — harmless to leave in the config.
-
Spawning and NBT —
/summon+ spawn-egg + NBT reference for individual mobs. - Personality System — how a spawned PlayerMob picks its dispositions.
- README — player-facing overview.
Getting started
In-game commands
No-code (datapacks)
Java API
Patterns