You can make custom entities randomly spawn in your world, exactly how vanilla mobs do.
This is an example to make an example red_zombie spawn.
It will spawn only with a 20% chance of when a vanilla zombie spawns. It will replace the vanilla zombie with the custom one.
It will spawn only in worlds of which name starts by world, between world height 0 and 150 during weather RAIN and with light level from 0 to 10.
info:namespace:testentities:red_zombie:model_folder:entity/red_zombiecan_sun_burn:falsetype:ZOMBIEentities_populator:red_zombie_1:entity:test:red_zombiespawn_logic:method:REPLACE# or SPAWN_NEARtypes: - ZOMBIEchance:20.0amount:1worlds: - world*# you can also use x and z as location_range parameters, for example# to make edge of the worlds harder with more dangerous mobslocation_range:y:min:0max:150weather: - RAINlight_level:min:0max:10
All properties
entities_populator:
red_zombie:
entity: test:red_zombie
# This sets how to actually spawn the entity.
# By default uses REPLACE and types to all monsters and friendly
# You can replace a vanilla mob when it's spawned or spawn your mob near it.
# Note: This uses the Minecraft spawn logic, so gemerule `doMobSpawning false`
# will make this stop working.
spawn_logic:
method: REPLACE # or SPAWN_NEAR
types:
- ZOMBIE
chance: 20.0
amount: 1
# Optional
biomes:
- FOREST
- JUNGLE
worlds:
- world
- "!banned_other_world"
- "test_world_*"
# you can also use x and z as location_range parameters, for example
# to make edge of the worlds harder with more dangerous mobs
# Optional
location_range:
y:
min: 25
max: 45
# Optional
weather:
- CLEAR
- RAIN
- THUNDER
- SNOW
# you can create more intervals, this is useful
# to introduce dynamicity to your gameplay
# Optional
time:
interval_1:
min: 12000 # sunset. also supports the 'sunset' word directly
max: 23000 # sunrise. also supports the 'sunrise' word directly
# Optional
light_level:
min: 0
max: 5