- Add the datapack to your world
- Run
/reload
- Note: Every time the world is reloaded or the reload command is run, this RNG system will reset to the default seed of 14 and it's initial state
- Initially, the system is set up to simulate a roll of a 6-sided dice ($rng_max = 6; $rng_min = 1)
- Run the command
/function rng:next
- Your random value will be in the scoreboard
rng
under player$value
- It is important to note that all values generated will be positive
- Set the score for either
$rng_max
or$rng_min
- Note: the system does not bounds check these values. Setting max less than min or either value negative will result in undefined behavior
- Set a value into the scoreboard
rng
for player$seed
- Run
/function rng:seed
- This will reset the RNG system to the default state for the given seed
- If you have a scoreboard called
rng
, please either change the name of that scoreboard or the one used by this datpack (in all places it occurs)