Random System
Estimated reading time: 2 minutesrandSystem creates reproducible random number generators. Use it when a mod needs saved seeds, repeatable results, replayable random events, backtracking, or easier debugging.
For one-off randomness, global helpers such as random() or either() may be enough. Use maplebirch.tool.rand.create() when the same state should produce the same sequence.
Create A Generator
With save-backed state:
create(state) uses the passed object as its internal state, so storing that object in V lets the sequence follow the save.
Minimal Example
API
Reproducible Rolls
Percentage Check
Array Pick
Back And Forward
forward(steps) only moves through already generated history. It does not create new random values.
Save Data
Store the full state object when the sequence should belong to the save:
The state contains seed, history, and index. Saving only seed reproduces a sequence from the beginning; saving the full state restores the exact walked history.
