StructureSpawns 5.46.0
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) : arrayhasProviders()
php
public static function hasProviders() : boolprepare()
php
public static function prepare(\pocketmine\world\World $world) : voidLets 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) : voidunregister()
php
public static function unregister(\pocketmine\world\mobs\spawn\StructureSpawnProvider $provider) : void