Skip to content

StructureSpawns 5.46.0 ​

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

Registry of StructureSpawnProviders used by every world's natural mob spawner.

Methods ​

getSpawnAreas() ​

php
public static function getSpawnAreas(\pocketmine\world\World $world, int $x, int $z) : array

hasProviders() ​

php
public static function hasProviders() : bool

prepare() ​

php
public static function prepare(\pocketmine\world\World $world) : void

Lets the providers set up what they need for the world (e.g. the vanilla structure manager, which builds a whole world generator) when the world loads, instead of during the first spawn attempt: that took up to 2 seconds of a single tick when the first player arrived in the world.

register() ​

php
public static function register(\pocketmine\world\mobs\spawn\StructureSpawnProvider $provider) : void

unregister() ​

php
public static function unregister(\pocketmine\world\mobs\spawn\StructureSpawnProvider $provider) : void

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