/random Command Generator
BetaSet a range, choose whether everyone sees the result, and optionally store it in a score. The preview rolls the dice.
Describe it — AI writes the command
Type what you want in plain words. The AI fills the form below, so you can see it and change anything. It follows the edition and version you picked.
Checking the AI…
Paste a command— edit it here or move it to another version
Your command · Java 26.3
18 characters/random value 1..6
- random value shows the result only to whoever ran it.
Raw editor
How it works
/random was added in Java 1.20.2. The range is inclusive: 1..6 gives 1 to 6.
random value 1..6 random roll 1..100 random value 1..6 my_pack:loot execute store result score @s dice run random value 1..6
value shows the result only to whoever ran it; roll announces it to everyone. A named sequence gives the same numbers in the same order for a world.
random reset * random reset my_pack:loot 42 false
Bedrock has no /random — use scoreboard players random instead.
FAQ
How do I get a random number into a scoreboard?
execute store result score @s dice run random value 1..6 — create the objective first with scoreboard objectives add dice dummy.
What is the difference between value and roll?
value tells only the one who ran it (good for command blocks), roll writes the result in everyone's chat.
What are random sequences?
Named generators that give a repeatable series of numbers per world; reset them to start over or change the seed.
Why doesn't /random work?
It needs Java 1.20.2 or later. Older versions can use scoreboard tricks or loot tables.
Is there /random on Bedrock?
No. Bedrock has scoreboard players random <target> <objective> <min> <max>.