Skip to main content

Module legacy_random

Module legacy_random 

Source
Expand description

This module contains the legacy random number generator implementation.

Structsยง

LegacyRandom
Legacy Minecraft random number generator based on a Linear Congruential Generator (LCG). This implementation mirrors Javaโ€™s java.util.Random which Minecraft originally used.
LegacyRandomSplitter
A positional random number generator factory for the legacy Minecraft LCG algorithm. This can create random sources based on position, hash, or seed.

Constantsยง

LCG_A ๐Ÿ”’
LCG multiplier (matches java.util.Random).
LCG_C ๐Ÿ”’
LCG additive constant (matches java.util.Random).
LCG_MASK ๐Ÿ”’
48-bit state mask.