SpawnReason 5.46.0
Why a mob came into the world (like Paper's CreatureSpawnEvent.SpawnReason). It is kept with the mob (Living::getSpawnReason()) and saved with it. The natural spawner uses it for its population caps (mobs.spawning.count-all-mobs-for-spawning in pocketmine.yml).
Plugins may use their own reasons (any string); mobs of plugin classes count as SpawnReason::CUSTOM.
Constants
BREEDING
public const BREEDING = "breeding"Two mobs bred.
CUSTOM
public const CUSTOM = "custom"A plugin spawned the mob.
DEFAULT
public const DEFAULT = "default"The reason was not recorded (mobs created before reasons existed, or by code that does not set one).
NATURAL
public const NATURAL = "natural"Natural spawning around players with the spawn rules.
NATURAL_REASONS
public const NATURAL_REASONS = [self::NATURAL, self::STRUCTURE, self::WANDERING_TRADER, self::VILLAGE_CAT, self::PATROL]Reasons that count as natural spawning when count-all-mobs-for-spawning is false.
PATROL
public const PATROL = "patrol"A pillager patrol.
RAID
public const RAID = "raid"A raid wave.
SPAWNER
public const SPAWNER = "spawner"A monster spawner block.
SPAWN_EGG
public const SPAWN_EGG = "spawn_egg"A spawn egg used by a player or a dispenser.
STRUCTURE
public const STRUCTURE = "structure"Spawns of a structure (witch huts, nether fortresses, ocean monuments...).
VILLAGE_CAT
public const VILLAGE_CAT = "village_cat"A stray cat of a village.
WANDERING_TRADER
public const WANDERING_TRADER = "wandering_trader"A wandering trader and its llamas.
