BundledSpawnRules 5.47.0
Compact table of the vanilla spawn rules shipped in resources/vanilla_spawn_rules.json: the SpawnConditions and populations that VanillaSpawnRules::loadFrom() reads from Mojang's files, as plain values. It is used when Mojang's files are not in the server's data folder, so that a server without network (or on its first start) spawns every vanilla mob instead of only the SpawnRules::builtin() ones.
Generated by tools/generate-vanilla-spawn-rules.php from the files pinned by VanillaSpawnRules::FILES; do not edit the JSON by hand. Only the values differing from the constructor defaults are stored.
Constants
FILE
public const FILE = "vanilla_spawn_rules.json"Methods
decode()
public static function decode(array $data) : ?\pocketmine\world\mobs\spawn\SpawnRulesReads rules in the bundled format; null if they were made for another Bedrock version.
encode()
public static function encode(\pocketmine\world\mobs\spawn\SpawnRules $rules) : arrayConverts rules to the bundled format (generator).
get()
public static function get() : ?\pocketmine\world\mobs\spawn\SpawnRulesReturns the bundled rules (read once), or null if the file is missing, damaged or made for another Bedrock version than VanillaSpawnRules::TAG.
loadFile()
public static function loadFile(string $path) : ?\pocketmine\world\mobs\spawn\SpawnRulestoJson()
public static function toJson(\pocketmine\world\mobs\spawn\SpawnRules $rules) : string