Data Packs Other

Random Number Generator (RNG) for datapacks

  • 6.6k views 0 today
  • save_alt 713 downloads
Compatibility
Minecraft 1.16
to version
Minecraft 1.19
Changes include
  • Functions
  • 14
  • 12
  • 3
natural_power
Lvl 46Master Miner
16
Get jus the .mcfunction file

A very simple and easy to use RNG for datapacks
This datapack/.mcfunction file allows you to easily generate a random number for all your randomizing needs!



HOW TO USE:

INSTALLATION:
Simply get the .mcfunction file out of the datapack and put it into your datapack!

USE:
1. Run "/scoreboard players set min rng <minimum number>" to set a minimum number
2. Run "/scoreboard players set max rng <maximum number>" to set a maximum number
3. Run "/function <pack_name>:rng" to generate the number
4. Your ranom number between the given minimum and maximum is now stored as "out" in "rng"
(Get it with "/scoreboard players operation <PLAYER> <SCOREBOARD> = out rng")

*You don't need to set the minimum and maximum every time, it'll use the last used
or the base which is min 0, max 100

CREDIT: You're free to use this datapack for anything as long as the credits that are there stay inside the .mcfunction file

More like this

  Have something to say?

justwillywastaken
12/05/2022 8:30 am
Level 75 : Legendary uwu Professor
very epic and awesome
1
Gebakken Lucht
10/16/2022 2:31 am
Level 27 : Expert Miner
history
hi how can i execute a command if the score of "out" maches a specific number

for exaple it matches the number 2 and than it says hi it worked
2
natural_power
11/10/2022 10:00 am
Level 46 : Master Miner
Oof well I'm a month late to this but it'd be
/execute if score out rng matches <number> run <command>
1

Welcome