Data Packs Other

Random Number Generator RNG

  • 3.9k views 0 today
  • save_alt 124 downloads
Compatibility
Minecraft 1.14
to version
Minecraft 1.18
Changes include
    • 3
    • 2
    • 2
    JustADino_
    Lvl 28Expert Toast
    5
    RNG DATA PACK:

    Description:

    This datapack adds a random number generator, either for use in your own data pack or for use normally.

    Instructions:
    To start generating a number, type "/function startrng.mcfunction" in chat. You will see your random number in chat!

    Installation:
    1. Create a new Minecraft world (optional).
    2. Go to your your app data folder, on Windows you can use win+r and then type "%AppData%"
    3. Open the ".minecraft" folder, open the "saves" folder, open the folder of the world you want to install this datapack on, and then open the "datapacks" folder
    4. Unzip the datapack into it's own folder and drag it in the "datapacks" folder.
    5. Use the datapack

    Set Up:

    For use with your own Data Pack (READ CAREFULLY!)
    Go into your own load function, and add a comma after the last quoteCreate a new line and paste in ""rng:rng/rngload"" (remember to change the namespace).

    Go through all the files in this data pack and replace "rng:" with your own name space. (tip: you can use [​ctrl+h] to replace and [​ctrl+f] to find)
    Inside the RNG data pack, go into RNG > data > rng > functions, and copy/paste the rng folder into your datapack's function folder.

    Go through it and replace the "test" scoreboard with your own. That scoreboard is for the entity. After the random number is generated. You will save the score to the entity you want to save it to with the command:
    "scoreboard players operation <entity to save randomly generated number to> <your scoreboard> = @e[​tag=chose1,limit=1] rngnumber".

    Make sure in the "rngload" function, you replace "scoreboard objectives add test dummy" with your own scoreboard, or put it in your own load function and you can delete that scoreboard completely.

    You can change what message you get of the number in the "success.mcfunction" file, and the error message for spamming the command in the "startrng.mcfunction" file.Then you are done setting it up!


    This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

    More like this

      Have something to say?

    DDSH1231
    02/17/2022 10:01 pm
    Level 1 : New Explorer
    how do you make that text pls tell :))))
    1
    JustADino_
    02/17/2022 10:35 pm
    Level 28 : Expert Toast
    well basically i made an array of armor stands, 4 rows for each digit, 9 collumns for each number.
    it picks a random number out of each row, puts them together into a 4 digit number and sends it to you
    1

    Welcome