Skip to content

BiomeLocator 5.46.0 ​

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

Finds the closest biome of a type for /locate biome. Worlds made by the vanilla generator are searched from the climate noise on an async worker without generating chunks (up to BiomeSearch::DEFAULT_RADIUS blocks); worlds of other generators can only be searched in their loaded chunks.

Biome names may be Bedrock ids ("mesa", "roofed_forest") or Java Edition ids ("badlands", "dark_forest"), with or without the "minecraft:" prefix.

Methods ​

getBedrockBiomeNames() ​

php
public static function getBedrockBiomeNames() : array

Bedrock biome names (the client suggests them for /locate biome).

getKnownBiomeNames() ​

php
public static function getKnownBiomeNames() : array

Every biome name /locate biome understands (Bedrock and Java Edition ids), for command suggestions.

locate() ​

php
public static function locate(\pocketmine\world\World $world, string $biome, \pocketmine\math\Vector3 $origin, \Closure $onCompletion, int $radius = \pocketmine\world\locate\BiomeSearch::DEFAULT_RADIUS, int $timeoutSeconds = 0) : bool

Starts searching the closest biome named $biome from $origin. Returns false if no biome has that name; otherwise $onCompletion is called with the block position found (null if none), either right away or when the async search finishes ($failed = true if the search crashed, $timedOut = true if it gave up after $timeoutSeconds). Vanilla worlds are searched on the LocateWorkerPool, not on the server's async pool, which generates chunks.

resolveBiomeName() ​

php
public static function resolveBiomeName(string $name) : ?array

Returns the Java Edition biome ids and the Bedrock biome ids named by the given name, or null if no biome has that name.

searchLoadedChunks() ​

php
public static function searchLoadedChunks(\pocketmine\world\World $world, array $bedrockIds, \pocketmine\math\Vector3 $origin, int $radius = \pocketmine\world\locate\BiomeSearch::DEFAULT_RADIUS) : ?\pocketmine\math\Vector3

Closest position (horizontally) in the world's loaded chunks whose biome is one of $bedrockIds, sampled every 4 blocks at the origin's height and every BiomeSearch::DEFAULT_VERTICAL_STEP blocks above and below.

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