Minecraft:Commands/random: Difference between revisions
More actions
imported>LauraFii m Undo revision 3516307 by ~2026-EmeraldStoneCamel8319 (talk) test edit |
Remove broken links to missing pages |
||
| Line 7: | Line 7: | ||
}} | }} | ||
Generates a random integer, or controls | Generates a random integer, or controls random sequences in the world. | ||
== Syntax == | == Syntax == | ||
| Line 42: | Line 42: | ||
{{argument|sequence|resource_location}} | {{argument|sequence|resource_location}} | ||
: Specifies the | : Specifies the resource location of a random sequence to sample or reset. | ||
: If there's no sequence with the specified | : If there's no sequence with the specified resource location, it is created. | ||
: {{arg desc|je=resource_location}} | : {{arg desc|je=resource_location}} | ||
| Line 98: | Line 98: | ||
{{Navbox commands}} | {{Navbox commands}} | ||
de:Befehl/random | |||
ja:コマンド/random | |||
pt:Comandos/random | |||
ru:Команды консоли/random | |||
zh:命令/random | |||
Revision as of 15:44, 9 April 2026
Template:Exclusive Template:Infobox command
Generates a random integer, or controls random sequences in the world.
Syntax
random (value|roll) <range>
- Outputs a random integer.
- Range is given by two integers separated by two periods where the first given number must always be smaller than the second given number.
random (value|roll) <range> <sequence>
- Samples a random integer from the specified random sequence. If the sequence does not exist, it is created with the random sequence settings of the world.
random reset *
- Removes all the random sequences in the world. A random sequence is created with the settings of the world when called by a loot table.
random reset * <seed> [<includeWorldSeed>] [<includeSequenceId>]
- Removes all the random sequences in the world, and sets the random sequence settings of the world. The setting of the world is
0,true,true, if having not executed/random reset * ...command in the world.
random reset <sequence>
- Removes and re-creates a random sequence with the settings of the world. If the sequence does not exist, it is just created.
random reset <sequence> [<seed>] [<includeWorldSeed>] [<includeSequenceId>]
- Removes and re-creates a random sequence with the specified settings instead of the settings of the world. If the sequence does not exist, it is just created.
Arguments
- Whether or not to notify other players of the results when extracting random numbers.
- If it is
value, the result is displayed in chat only to the player executing the command. Ifroll, the result is broadcasted to all players.
- Specifies the range to pick the random number from. The size of the range (calculated by
max - min + 1) should be between 2 and 2147483646. - Template:Arg desc
- Specifies the resource location of a random sequence to sample or reset.
- If there's no sequence with the specified resource location, it is created.
- Template:Arg desc
- The salt value.
- Template:Arg desc
- Whether to incorporate the world seed value with the specified
<seed>when seeding a random sequence. If not specified, defaults totrue. - Template:Arg desc
- Whether to incorporate the hash of the ID with the specified
<seed>when seeding a random sequence. If not specified, defaults totrue. - Template:Arg desc
Examples
Rolls a random number between 1 and 5 and writes it in chat
Generates a random number between 1 and 10 and stores it in a scoreboard called Template:Code for the nearest player
Generates a number between 1 and 3 and displays it with message "Rolled number <rolled number>"
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
History
de:Befehl/random ja:コマンド/random pt:Comandos/random ru:Команды консоли/random zh:命令/random