
Command
/random
Draws a random whole number from a range, privately or announced to everyone, and resets the random sequences used by the world.
| /random reset * [<seed> [<includeWorldSeed> [<includeSequenceId>]]] |
| /random reset <sequence> [<seed> [<includeWorldSeed> [<includeSequenceId>]]] |
| /random (roll <range>|value <range>) [<sequence>] |
| Argument | Kind of value | What to type |
|---|---|---|
| <seed> | Whole number | For reset: a whole number that is mixed into the starting point of the sequence. |
| <includeWorldSeed> | True or false | For reset: true to mix in the world seed so that different worlds give different numbers, false to give the same numbers in every world. Default true. |
| <includeSequenceId> | True or false | For reset: true to mix in the sequence's id so that different sequences give different numbers, false to make sequences with the same seed identical. Default true. |
| <sequence> | Id | For value and roll: the id of a random sequence to draw from (optional, needs permission level 2). For reset: the sequence to restart, or * for all sequences. |
| <range> | Whole number range | For value and roll: the lowest and highest possible number, written as min..max, for example 1..6. |
| Permission level | 0: every player |
| Works in | /random value and /random roll with only a range can be used by everyone, without operator status or cheats, in singleplayer, on multiplayer servers, in command blocks and in functions. Naming a sequence and /random reset need permission level 2 (gamemasters): singleplayer with cheats enabled, operators on multiplayer servers, command blocks and functions. |
| Result | value reports "Randomized value: <number>" to the sender only; roll announces "<name> rolled <number> (from <min> to <max>)" to all players. For both, the number /execute store saves is the number drawn. reset reports "Reset random sequence <id>" with result 1, or "Reset <number> random sequence(s)" with the number of sequences as the result. |
| value and roll | Both draw a number between the two ends of the range, ends included. value shows the number only to whoever ran the command; roll tells every player. |
| Range limits | The range must have two different ends, such as 1..6. A single number fails with "The range of the random value must be at least 1". The difference between the ends must be below 2147483647, so a range with an open end such as 1.. is usually too large. |
| Sequences | Without a sequence the number comes from the world's general randomness. With a sequence id it comes from that named sequence, which gives the same numbers in the same order every time it is reset to the same seed. A sequence is created the first time it is used. |
| reset <sequence> | Restarts one sequence. Without a seed it uses the world's current default settings; with a seed it uses that seed. |
| reset * | Removes all sequences so that each starts again when it is next used. With a seed, the seed and the two true/false settings also become the new defaults for every sequence in the world. |
| Seed settings | includeWorldSeed and includeSequenceId are both true when left out. |
/random value 1..6Draws a number from 1 to 6 and shows it only to you.
/random roll 1..20Draws a number from 1 to 20 and announces it to all players.
/random value 1..100 minecraft:my_diceDraws a number from 1 to 100 from the sequence minecraft:my_dice.
/random reset minecraft:my_dice 12345Restarts the sequence minecraft:my_dice with the seed 12345.
/random reset *Resets every random sequence in the world.
/random reset * 42 false trueResets all sequences and makes seed 42 without the world seed the new default.

