![]() |
VOOZH | about |
/random| Permission level required |
|
|---|---|
| Restrictions | None |
{
"title": "<code>/random</code>",
"rows": [
{
"field": "\n*0 (<code>/random (rollvalue)</code> without the <code><sequence></code> argument)\n*2 (<code>/random reset</code> and the <code><sequence></code> argument in <code>/random (rollvalue)</code>)",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Generates a random integer, or controls random sequences in the world.
random (value|roll) <range>
random (value|roll) <range> <sequence>
random reset *
random reset * <seed> [<includeWorldSeed>] [<includeSequenceId>]
0, true, true, if having not executed /random reset * ... command in the world.random reset <sequence>
random reset <sequence> [<seed>] [<includeWorldSeed>] [<includeSequenceId>]
value|roll
value, the result is displayed in chat only to the player executing the command. If roll, the result is broadcasted to all players.<range>: int_range
max - min + 1) should be between 2 and 2147483646.0 - exact match of 0. ..0 - less than or equal to 0. 0.. - more than or equal to 0. 0..1 - from 0 to 1, both inclusive.)<sequence>: resource_location
<seed>: int
<includeWorldSeed>: bool
<seed> when seeding a random sequence. If not specified, defaults to true.true or false).<includeSequenceId>: bool
<seed> when seeding a random sequence. If not specified, defaults to true.true or false)./random roll 1..5
Rolls a random number between 1 and 5 and writes it in chat
execute store result score @p random_number run random value 1..10
Generates a random number between 1 and 10 and stores it in a scoreboard called random_number for the nearest player
/execute store result score player random_number run random value 1..3
/tellraw @a [{text:"Rolled number "},{"score": {"name": "player", "objective": "random_number"} }]
Generates a number between 1 and 3 and displays it with message "Rolled number <rolled number>"
| Command | Trigger | Java Edition |
|---|---|---|
| Any | the arguments are not specified correctly | Unparseable |
/random (value|roll) ... | <range>range is less than 2 or greater than 2147483646 | Failed |
| Any | Otherwise | Successful |
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
/random (value|roll) ... | On success | 1 | 1 | the obtained random value | |
/random reset <sequence> ... | On success | 1 | 1 | 1 | |
/random reset * ... | On success | 1 | 1 | the number of random sequences currently in the world |
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.20.2 | 23w31a | Added /random. | |||||