Providers 5.46.0
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) : \ClosureVerticalAnchor: {"absolute": y} | {"above_bottom": n} | {"below_top": n} | {"relative_to_sea_level": n}
f()
php
public static function f(float $x) : floatfloat()
php
public static function float(mixed $json) : \Closureheight()
php
public static function height(mixed $json) : \Closureint()
php
public static function int(mixed $json) : \pocketmine\world\generator\vanilla\feature\IntProviderpick()
php
public static function pick(\pocketmine\world\generator\vanilla\feature\FeatureRandom $random, array $items, array $weights, int $total) : mixedWeightedList.getRandomOrThrow().
str()
php
public static function str(mixed $json) : stringvec3()
php
public static function vec3(mixed $json) : arrayParses a Vec3i ([x, y, z]), defaulting to 0 0 0.
weightedList()
php
public static function weightedList(mixed $json, \Closure $parse) : arrayParses a weighted list ([{"data": ..., "weight": n}, ...]).
