Skip to content

LegacyMobSpawner 5.46.0 ​

final class · pocketmine\world\mobs\LegacyMobSpawner · source

The simplified spawning used before the vanilla Bedrock algorithm (mobs.spawning.mode: legacy):

  • packs spawn 24 to 44 blocks away from a player, in loaded chunks with calculated light, never within 24 blocks of any player;
  • passive animals on grass blocks at the surface with light 9 or more;
  • hostile mobs on solid opaque blocks with block light 0 and sky light (after the time of day) of 7 or less, i.e. at night or in caves, never in peaceful;
  • each category has a cap per player, counting the mobs within 64 blocks of the player.

Naturally spawned monsters are not persistent and despawn far from players (see MobDespawner). Animals are persistent, as before.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\World $world)

tick() ​

php
public function tick(int $currentTick) : void

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