Skip to content

Providers 5.46.0 ​

final class · pocketmine\world\generator\vanilla\feature\Providers · source

Parsers of vanilla's value providers (IntProvider, FloatProvider, HeightProvider, VerticalAnchor) and weighted lists, with the exact random call sequences of Java 26.3. Float providers work in float32 like Java.

Methods ​

anchor() ​

php
public static function anchor(mixed $json) : \Closure

VerticalAnchor: {"absolute": y} | {"above_bottom": n} | {"below_top": n} | {"relative_to_sea_level": n}

f() ​

php
public static function f(float $x) : float

float() ​

php
public static function float(mixed $json) : \Closure

height() ​

php
public static function height(mixed $json) : \Closure

int() ​

php
public static function int(mixed $json) : \pocketmine\world\generator\vanilla\feature\IntProvider

pick() ​

php
public static function pick(\pocketmine\world\generator\vanilla\feature\FeatureRandom $random, array $items, array $weights, int $total) : mixed

WeightedList.getRandomOrThrow().

str() ​

php
public static function str(mixed $json) : string

vec3() ​

php
public static function vec3(mixed $json) : array

Parses a Vec3i ([x, y, z]), defaulting to 0 0 0.

weightedList() ​

php
public static function weightedList(mixed $json, \Closure $parse) : array

Parses a weighted list ([{"data": ..., "weight": n}, ...]).

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