Minecraft Wiki

The Minecraft Wiki has moved from Fandom; see the linked discussion page for details.

READ MORE

Minecraft Wiki
Advertisement
Information icon
This feature is exclusive to Java Edition. 

The /random command can be used to draw a random value.

Syntax

/random value|roll <range> [<sequenceId>]

  • Extract random numbers.

/random reset *|<sequenceId> [<seed>] [<includeWorldSeed>] [<includeSequenceId>]

  • Reset the random number sequence.

Arguments

value|roll
Whether or not to notify other players of the lottery results when extracting random numbers. value Nara lottery results are displayed only to you roll Nara reveals the lottery results to all players.

range
Specify the range of random numbers to generate. The size of the range must be between 2 and 2147483646. If the upper and lower limits are not specified, 2147483647 and -2147483648 are assumed respectively. Specify as an integer within the value range (e.g. 0-exactly 0, ..0-0 or less, 0..-0 or more, 0..1-0 or more and 1 or less).

sequenceId
Specify the namespace ID of the random number string to be used/reset . random value|roll... Optional in syntax. The syntax can also specify random reset... instead *, in which case all random numbers will be reset. If you specify a random number string that does not exist, the random number string is created on the spot and the command is executed.

seed
The seed value used to reset the random number sequence.

includeWorldSeed
Whether to incorporate the world seed value when seeding the random number sequence. false If set to , the random number sequence will be reset in the same way regardless of the world. If you do not specify it, false it is assumed that you have specified.

includeSequenceId
Whether to include the ID of the random number column when seeding the random number column. false If set to , the result of resetting the random number sequence will be the same regardless of the random number sequence ID. If you do not specify it, false it is assumed that you have specified.

Result

CommandTriggerJava Edition
anyIncorrectly specified arguments Unparseable
random (value|roll) ...<range>range is less than 2 or greater than 2147483646 Failed
anyOtherwiseSuccessful

Output

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava Editionwhen failed000
/random (value|roll) ...when successful11sampled random value
/random reset ...when successful11number of random number sequences reset

History

Java Edition
1.20.223w31aAdded random.
Advertisement