Skip to content

PopulationCaps 5.46.0 ​

final class · pocketmine\world\mobs\spawn\PopulationCaps · source

Bedrock population caps: the maximum number of naturally spawned mobs of each population type in the 9x9 chunks around the chunk of a spawn attempt, separately for surface and underground ("cave") spawns, per dimension. Values from https://minecraft.wiki/w/Mob_spawning (Bedrock Edition, population caps).

Constants ​

AREA_RADIUS_CHUNKS ​

php
public const AREA_RADIUS_CHUNKS = 4

The caps count the mobs within this many chunks (9x9 square) of the spawn attempt's chunk.

GLOBAL_CAP ​

php
public const GLOBAL_CAP = 200

Bedrock global cap: naturally spawned mobs in the ticking area of a dimension.

Methods ​

get() ​

php
public static function get(\pocketmine\world\dimension\Dimension $dimension, string $population, bool $surface) : int

Returns the cap of the population type in the dimension (0 for unknown types, e.g. "cat": cats spawn in villages only, see \pocketmine\world\mobs\VillageCatSpawner).

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.