Skip to content

VillageScanner 5.46.0 ​

final class · pocketmine\world\raid\VillageScanner · source

Finds the villages around a position (see Village) from the blocks of the loaded chunks. Sub-chunks whose palette has no POI block are skipped without reading their blocks, so a scan costs little unless there are many POIs around. Villages are built from the POIs cached by the world's PoiManager, with the beds and job sites claimed by villagers marked as such.

Constants ​

SCAN_HORIZONTAL ​

php
public const SCAN_HORIZONTAL = \pocketmine\world\raid\Village::BORDER_HORIZONTAL + \pocketmine\world\raid\Village::EXPANSION_HORIZONTAL

Horizontal and vertical reach of a scan around the position.

SCAN_VERTICAL ​

php
public const SCAN_VERTICAL = 32

Methods ​

findBlocks() ​

php
public static function findBlocks(\pocketmine\world\World $world, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ, array $types) : array

Returns the blocks of the given types in the loaded chunks of the box, reading only the sub-chunks whose palette has one of them.

findPoiBlocks() ​

php
public static function findPoiBlocks(\pocketmine\world\World $world, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ) : array

Returns the POIs in the loaded chunks of the box with their block type IDs. Beds count once, at their head.

findPois() ​

php
public static function findPois(\pocketmine\world\World $world, int $minX, int $minY, int $minZ, int $maxX, int $maxY, int $maxZ) : array

Returns the POIs in the loaded chunks of the box. Beds count once, at their head.

findVillageAt() ​

php
public static function findVillageAt(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : ?\pocketmine\world\raid\Village

Returns the village nearest to the position whose boundary contains it, if any.

findVillageForOmen() ​

php
public static function findVillageForOmen(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : ?\pocketmine\world\raid\Village

Returns the village whose Raid Omen region (see Village::isInOmenRange()) contains the position, if any.

findVillages() ​

php
public static function findVillages(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, int $horizontal = self::SCAN_HORIZONTAL, int $vertical = self::SCAN_VERTICAL) : array

Returns the villages found around the position (scanning VillageScanner::SCAN_HORIZONTAL blocks around horizontally and VillageScanner::SCAN_VERTICAL vertically).

getPoiTypes() ​

php
public static function getPoiTypes() : array

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