Data Packs Game Mechanic

math.random (Random Number Generator)

  • Functions
  • 12,442 views • 2 today
  • 1,171 downloads • 0 today
  • 21
  • 18
  • 7
fafik77
Level 66 : High Grandmaster Miner
54
A random number generator that uses pure math instead of entities.

Usage for datapack creators:
  1. set range min  scoreboard players set min RNG_77 0
  2. set range max  scoreboard players set max RNG_77 100
  3. run generator  function fafik77:rng/rand
  4. get the number  scoreboard players get number RNG_77
CompatibilityMinecraft 1.14
toMinecraft 1.15
Tags

1 Update Logs

Update #1 : by fafik77 04/29/2020 6:10:13 amApril 29, 2020 @ 10:10 am UTC

should work on 1.14 - 1.16
(might also work on lower versions)

  Have something to say?

Tigerfury26
12/27/2024 7:17 pm
Level 31 : Artisan Nether Knight
thank u we love u
1
Dream82342
08/10/2024 11:47 pm
He/Him • Level 22 : Expert uwu Aesthetic
I Am Making A Rpg World To Me And My Friends And I Was Trying To Find A Way To Generate Random Number This Datapack Helpme A Lot Because Now I Can Randomize Mobs Effects And Armors
1
RkeyCap
02/16/2023 9:21 am
Level 43 : Master System
fafik thanks for the random algorithm. I used it for my datapack
1
-fish
08/29/2021 10:45 pm
Level 44 : Master Fish
This could come in handy in the future, so I'll keep an eye on it if I need a RNG!
1
dynamite14
07/21/2021 6:16 pm
Level 1 : New Explorer
history
This is incredibly useful! Thanks so much for making this!

Edit: Can I use this in my own datapack? Do I need to credit you?
2
fafik77
07/28/2021 11:41 am
Level 66 : High Grandmaster Miner
you are free to use functionality/code of this datapack freely.
this code was also added to my fafik77 main.Lib
1
tranthanhduyst
06/03/2021 7:42 pm
Level 1 : New Miner
history
Worked perfectly!

Thanks for making this datapack :3

It is really helpful for me :D
1

Welcome