Random number generator code

Started by RabiTheCheetah on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Random number generator code

So I am trying to make it so that there is a 1/1000 chance of a random event happening. I thought this would work, but it doesn't, and I am unsure what to do next. I used google, but only found code that worked in tens 10%, 20%, etc. I don't know where I can find a way to make the chance smaller than 1/10.

Current code I am trying to use: https://imgur.com/a/rPoS9pI

If anyone can help, it would be appreciated.

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
use the random integer,…
Wed, 09/17/2025 - 12:43

use the random integer, number includes decimals like .01