SlimeChunk 5.46.0
Bedrock slime chunks. Unlike Java Edition they do not depend on the world seed: the chunk is a slime chunk when the first output of a Mersenne Twister (MT19937) seeded with (chunkX * 0x1f1f1f1f) ^ chunkZ (32-bit unsigned) is a multiple of 10, i.e. about 1 chunk in 10.
Reverse engineered by @protolambda and @jocopa3 (https://gist.github.com/protolambda/00b85bf34a75fd8176342b1ad28bfccc), as used by https://github.com/depressed-pho/slime-finder-pe, whose known slime chunks are checked by the tests.
Methods
firstMt19937Output()
php
public static function firstMt19937Output(int $seed) : intFirst 32-bit output of MT19937 seeded with $seed. Only the state words 0, 1 and 397 are needed for it.
isSlimeChunk()
php
public static function isSlimeChunk(int $chunkX, int $chunkZ) : bool