Skip to content

BiomeSearch 5.46.0 ​

final class · pocketmine\world\locate\BiomeSearch · source

Searches outwards from a position for the closest column where a predicate matches, ring by ring (like Java Edition's BiomeSource.findClosestBiome3d): rings of growing radius in steps of $horizontalStep blocks, and in each column the heights starting at the origin's Y and alternating outwards in steps of $verticalStep.

Constants ​

DEFAULT_HORIZONTAL_STEP ​

php
public const DEFAULT_HORIZONTAL_STEP = 32

DEFAULT_RADIUS ​

php
public const DEFAULT_RADIUS = 6400

Default search radius of /locate biome, in blocks (Java Edition uses the same).

DEFAULT_VERTICAL_STEP ​

php
public const DEFAULT_VERTICAL_STEP = 64

Methods ​

find() ​

php
public static function find(\Closure $matchColumn, int $originX, int $originZ, array $ys, int $radius = self::DEFAULT_RADIUS, int $horizontalStep = self::DEFAULT_HORIZONTAL_STEP, ?int $deadlineNs = null) : ?\pocketmine\math\Vector3

sampleHeights() ​

php
public static function sampleHeights(int $originY, int $minY, int $maxY, int $verticalStep) : array

Heights sampled in each column: the origin's Y, then +step, -step, +2*step... within [minY, maxY].

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