Topic category: Help with modding (Java Edition)
Okay, So i have a basic level of programing knowledge but am new to the software.
What im trying to do is have a "random" chance of obtaining a new item called a "Jewel" when mining for coal. So i have two varriables set ... first i have JewelRarity which has a default value of 10. I also have a JewelChance which has a default value of 1.
Number JewelRarity = 10
Number JewelChance = 1
So when a player mines coal, they get coal but i also want it to generate a random number between 1 and 10 (JewelRarity.) If this number equals 1 (Jewel Chance.) then the player will also get an Item a "Jewel."
I understand that i will probably need a third varriable for the random value to be assinged to before it can be compared to JewelChance. Im struggling with finding a way to have a varriable be a random number that is generated unique with each block of coal mined.
Any Advice would be very much appreciated