SetRandomSeed

Parameters
seed integer

New seed for the PRNG.

comment

Sets the internal PRNG's seed.

Useful for testing or when you want a repeatable outcome. WorldEdit has an option to run test maps with a fixed seed, you can achieve the same result with this.

Example:

SetRandomSeed(42)
GetRandomInt(0, 18) == 12
GetRandomInt(0, 18) == 2
SetRandomSeed(42)
GetRandomInt(0, 18) == 12
note

Desyncs! The random number generator is a global, shared resource. Do not change its state in local blocks asynchronously.

note

See: GetRandomInt, GetRandomReal.

patch

1.00

Source
common.j
return type
nothing
Source code
native SetRandomSeed            takes integer seed returns nothing