News
Game
Guides
Downloads
Versions
/random
COMMANDS COMMAND BLOCKS & MAPS EVERYONE 3 SUBCOMMANDS Added in 1.20.2

/random command in Minecraft

/random picks a random whole number in a range. value shows it only to you, roll announces it to every player, and both can feed a score through /execute store. Named sequences give repeatable results, and reset gives them a new seed.

Syntax

/random reset (*|<sequence>)
/random roll <range> [<sequence>]
/random value <range> [<sequence>]

// Exceptions: /random reset, /random roll <range> <sequence> and /random value <range> <sequence> need level 2.

All 12 forms
  • /random reset *
  • /random reset * <seed>
  • /random reset * <seed> <includeWorldSeed>
  • /random reset * <seed> <includeWorldSeed> <includeSequenceId>
  • /random reset <sequence>
  • /random reset <sequence> <seed>
  • /random reset <sequence> <seed> <includeWorldSeed>
  • /random reset <sequence> <seed> <includeWorldSeed> <includeSequenceId>
  • /random roll <range>
  • /random roll <range> <sequence>
  • /random value <range>
  • /random value <range> <sequence>
/random reset
/random reset (*|<sequence>)
ArgumentExpectsWhat it does
seedoptionalWhole numberWhole number used as the new seed of the sequence, for example 1234.
includeWorldSeedoptionaltrue / falsetrue or false: whether the world seed is mixed into the new seed.
includeSequenceIdoptionaltrue / falsetrue or false: whether the sequence ID is mixed into the new seed.
sequenceResource IDName of a random sequence, for example mypack:dice. Requires permission level 2.
All 8 forms
  • /random reset *
  • /random reset * <seed>
  • /random reset * <seed> <includeWorldSeed>
  • /random reset * <seed> <includeWorldSeed> <includeSequenceId>
  • /random reset <sequence>
  • /random reset <sequence> <seed>
  • /random reset <sequence> <seed> <includeWorldSeed>
  • /random reset <sequence> <seed> <includeWorldSeed> <includeSequenceId>
/random roll
/random roll <range> [<sequence>]
ArgumentExpectsWhat it does
rangeRange (1..5)Range to draw from, both bounds included, for example 1..6 or -10..10.
sequenceoptionalResource IDName of a random sequence, for example mypack:dice. Requires permission level 2.
All 2 forms
  • /random roll <range>
  • /random roll <range> <sequence>
/random value
/random value <range> [<sequence>]
ArgumentExpectsWhat it does
rangeRange (1..5)Range to draw from, both bounds included, for example 1..6 or -10..10.
sequenceoptionalResource IDName of a random sequence, for example mypack:dice. Requires permission level 2.
All 2 forms
  • /random value <range>
  • /random value <range> <sequence>

Examples

Roll a die for everyone

/random roll 1..6

Draws a number from 1 to 6 and announces the result to all players.

Java 26.3

Get a private random value

/random value 1..100

Shows a number from 1 to 100 to you only, for example "Randomized value: 42".

Java 26.3

Store the result in a score

/execute store result score @s dice run random value 1..6

Saves a number from 1 to 6 in your dice score, ready to test with execute if score.

Java 26.3

Draw from a named sequence

/random value 1..10 mypack:loot

Takes the next value of the mypack:loot sequence. Needs permission level 2.

Java 26.3

Reset a sequence with a seed

/random reset mypack:loot 1234

Gives mypack:loot the seed 1234, so the following values form a repeatable series in this world.

Java 26.3
Build your command

Fill in the fields, then copy the command.

Command generator

value, roll and permissions

random value 1..6 answers "Randomized value: 4" to you alone, while random roll 1..6 posts "Steve rolled 4 (from 1 to 6)" for everyone, like a dice throw on a server. Both bounds are included, so always write the two of them. Players without cheats can use value and roll on their own; a named sequence and reset need permission level 2.

Random values in maps

To act on the result, store it: execute store result score @s dice run random value 1..6, then test it with /execute if score @s dice matches 6. That is how random rewards, events or teleports are built with /scoreboard. To pick a random entity instead, a selector like @r or @e[sort=random,limit=1] is simpler, and /loot already handles random item drops.

Sequences and reset

A sequence is a named random generator, for example mypack:dice. Reset with the same seed, it produces the same series of values again, which helps for fair or reproducible minigames. reset sets a new seed, and its two booleans choose whether the world seed and the sequence ID are mixed into it. reset * resets every sequence at once.

✓ Checked in Java Edition 26.3 · updated 2 November 2026

/random: FAQ

Is the upper bound included in /random?

Yes, both bounds are included: 1..6 can return 1, 2, 3, 4, 5 or 6.

How do I put a random number into a score?

Use /execute store result score @s dice run random value 1..6. The dice score then holds the drawn number.

How do I use /random?

Type it in the chat, no cheats needed: /random roll <range> [<sequence>]. Exceptions: /random reset, /random roll <range> <sequence> and /random value <range> <sequence> need level 2.

Who can use /random?

Every player. Exceptions: /random reset, /random roll <range> <sequence> and /random value <range> <sequence> need level 2.

Since when does /random exist?

It is in the official command tree since Java Edition 1.20.2.

Related commands