Skip to content

BedrockSpreadPlacement 5.46.0 ​

final class · pocketmine\world\generator\vanilla\structure\placement\BedrockSpreadPlacement · source

Extends StructurePlacement

Bedrock Edition's random spread placement: like Java's (one placement chunk per spacing x spacing region), but the offset comes from a Mersenne Twister seeded with the region coordinates, the world seed and the structure salt.

The seeding constants come from public Bedrock seed tools and are NOT verified against BDS yet (see STRUCTURES-PLAN.md): compare with /locate on a Bedrock Dedicated Server before relying on exact positions.

Constants ​

REGION_X_MULTIPLIER ​

php
public const REGION_X_MULTIPLIER = -1683231919

REGION_Z_MULTIPLIER ​

php
public const REGION_Z_MULTIPLIER = -1100435783

Properties ​

$range ​

php
public readonly int $range

$spacing ​

php
public readonly int $spacing

$triangular ​

php
public readonly bool $triangular

Methods ​

__construct() ​

php
public function __construct(int $salt, int $spacing, int $range, bool $triangular, float $frequency = 1.0, int $frequencyReduction = self::REDUCTION_DEFAULT, ?string $exclusionSet = null, int $exclusionChunks = 0, array $locateOffset = [0, 0, 0])

getPotentialChunk() ​

php
public function getPotentialChunk(int $seed, int $regionX, int $regionZ) : array

getSpacing() ​

php
public function getSpacing() : int

isPlacementChunk() ​

php
public function isPlacementChunk(int $seed, int $chunkX, int $chunkZ) : bool

placementChunksIn() ​

php
public function placementChunksIn(int $seed, int $minChunkX, int $minChunkZ, int $maxChunkX, int $maxChunkZ) : array

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