Skip to content

StructureSpawnArea 5.46.0 ​

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

A Bedrock structure spawn area ("hard-coded spawn spots"): the box of a swamp hut (witches), an ocean monument (guardians), a pillager outpost (pillagers) or a nether fortress (blazes, wither skeletons, skeletons, magma cubes). When a cluster spawn attempt finds a spawnable block in a column inside the box, the spawner also tries to spawn one of these mobs on the highest spawnable block of the column within the box's Y range. Structure mobs count as underground ("cave") mobs and their population cap is one higher.

Provided by StructureSpawnProviders; PocketMine-MP does not generate these structures yet.

Properties ​

$maxBrightness ​

php
public readonly ?int $maxBrightness

$maxX ​

php
public readonly int $maxX

$maxY ​

php
public readonly int $maxY

$maxZ ​

php
public readonly int $maxZ

$minX ​

php
public readonly int $minX

$minY ​

php
public readonly int $minY

$minZ ​

php
public readonly int $minZ

$mobs ​

php
public readonly array $mobs

$persistent ​

php
public readonly bool $persistent

$population ​

php
public readonly string $population

Methods ​

__construct() ​

php
public function __construct(int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ, array $mobs, string $population = \pocketmine\world\mobs\spawn\SpawnCondition::POPULATION_MONSTER, bool $persistent = false, ?int $maxBrightness = null)

containsColumn() ​

php
public function containsColumn(int $x, int $z) : bool

pickMob() ​

php
public function pickMob() : ?array

Picks a mob by weight: [identifier, herd size], or null if there are none.

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