Skip to content

LocateCommand 5.46.0 ​

class · pocketmine\command\defaults\LocateCommand · source

Extends VanillaCommand
Implements ExhaustiveOverloads

Bedrock /locate:

  • /locate biome <biome>: the closest biome of that type (vanilla worlds are searched from the generator's noise up to 6400 blocks away without generating chunks; other worlds only in their loaded chunks)
  • /locate structure <structure> [useNewChunksOnly]: asks the world's StructureLocator (from the console: the default world, or its loaded Nether / End world if the structure only exists there)
  • /locate <structure> [useNewChunksOnly]: older Bedrock syntax (console and plugins only: clients get just the two syntaxes above, with their biome and structure lists, and no free-text overload)

Slow searches (vanilla biomes, AsyncStructureLocators) run on the LocateWorkerPool, never on the main thread nor on the async pool that generates chunks; each sender may have one search running at a time, at most MAX_PENDING_SEARCHES searches are queued, and each gives up after SEARCH_TIMEOUT_SECONDS. Results use the vanilla messages (commands.locate.*), which the client shows in its own language.

Constants ​

BEDROCK_STRUCTURES ​

php
public const BEDROCK_STRUCTURES = ["ancient_city", "bastion_remnant", "buried_treasure", "end_city", "fortress", "mansion", "mineshaft", "monument", "pillager_outpost", "ruined_portal", "ruins", "shipwreck", "stronghold", "temple", "trail_ruins", "trial_chambers", "village"]

Structure names of Bedrock's /locate structure (the client suggests them).

MAX_PENDING_SEARCHES ​

php
public const MAX_PENDING_SEARCHES = 4

Searches queued or running on the /locate worker at most (all senders together).

SEARCH_TIMEOUT_SECONDS ​

php
public const SEARCH_TIMEOUT_SECONDS = 60

A biome or structure search running longer than this is abandoned (and reported as not found).

STRUCTURE_RADIUS_CHUNKS ​

php
public const STRUCTURE_RADIUS_CHUNKS = 400

Search radius of /locate structure, in chunks (6400 blocks, like /locate biome).

Methods ​

__construct() ​

php
public function __construct()

execute() ​

php
public function execute(\pocketmine\command\CommandSender $sender, string $commandLabel, array $args)

getOverloads() ​

php
public function getOverloads() : array

suggestNames() ​

php
public static function suggestNames(string $typed, array $known, array $preferred = []) : array

Up to 3 known names close to what was typed ("ender" -> "end_city"), most similar first; $preferred names (the ones the client suggests) win over aliases that are as close.

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