Roll Numbers and Manage Random Sequences
The /random command lets you generate random numbers within a chosen range and control the random number sequences in your world. You can use it to roll a value or reset sequences back to a starting state.
Players and map makers use this command when building mini-games, rolling dice, or testing features that need predictable outcomes by setting a specific seed.
/random reset */random reset * <seed>/random reset * <seed> <includeWorldSeed> [<includeSequenceId>]/random reset <sequence>/random reset <sequence> <seed>/random reset <sequence> <seed> <includeWorldSeed> [<includeSequenceId>]/random roll <range> [<sequence>]/random value <range> [<sequence>]/random roll <range> [<sequence>]/random value <range> [<sequence>]/random reset */random reset * <seed>/random reset * <seed> <includeWorldSeed> [<includeSequenceId>]/random reset <sequence>/random reset <sequence> <seed>/random reset <sequence> <seed> <includeWorldSeed> [<includeSequenceId>]| Argument | Type | What it means |
|---|---|---|
<seed> | whole number | A positive or negative whole number, such as 5 or -3, used to reset a sequence. |
<includeWorldSeed> | true / false | A true or false value that decides whether the world seed is included when resetting. |
<includeSequenceId> | true / false | A true or false value that decides whether the sequence ID is included during a reset. |
<sequence> | resource ID | A namespaced resource ID that identifies a specific random sequence. |
<range> | number range | A number or number range to pick from, such as 5, 1..10, ..3, or 4... |
/random roll 1..6Rolls a number between 1 and 6 like a standard six-sided die.
/random value 10..100Picks a random value from the range of 10 to 100.
/random roll 1..20 custom:dice_checkRolls a number from 1 to 20 using a custom sequence named custom:dice_check.
/random value 0..1 minigame:coin_flipGenerates either a 0 or a 1 using the minigame:coin_flip sequence.
/random reset *Resets all random sequences in the current world.
/random reset * 42Resets every sequence in the world using the whole number 42 as the seed.
/random reset * -3 false trueResets all sequences with a seed of -3, excluding the world seed while including the sequence ID.
/random reset custom:loot_rollResets only the custom:loot_roll sequence back to its initial state.
/random reset arena:wave_spawner 999Resets the arena:wave_spawner sequence with a new seed of 999.
/random reset puzzle:door_code 12345 true falseResets the puzzle:door_code sequence with seed 12345, including the world seed and excluding the sequence ID.
Measured from the game files of every Java release from 1.13 to 26.3.
The /random command is only available in Minecraft Java Edition. Bedrock Edition does not have a command with this name.
The /random command was added to Minecraft Java Edition in version 1.20.2.
No, Bedrock Edition does not have a command named /random.
You can reset every sequence at the same time by running /random reset *, with the option to add a seed and true or false settings after the asterisk.
/bossbar/data/execute/function/return/schedule/scoreboard/tag/team/trigger