Skip to content

StructureSpawnProvider 5.46.0 ​

interface · pocketmine\world\mobs\spawn\StructureSpawnProvider · source

Tells the natural mob spawner where structure spawn areas are (see StructureSpawnArea), e.g. a structure generator remembering the swamp huts and fortresses it placed. Register with StructureSpawns::register().

Methods ​

getSpawnAreas() ​

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

Returns the structure spawn areas whose box contains the column (x, z) of the world. Called on the main thread for each successful cluster spawn attempt, so it must be cheap (e.g. a lookup by chunk).

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