random number not working?

Started by AxoMcreator on

Topic category: Troubleshooting, bugs, and solutions

Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
random number not working?

the code is working just fine if i ditch the variables and random numbers and just summon an entity, so i assume the problem is in the random part?

Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You will need to use random…
Sun, 06/22/2025 - 16:23

You will need to use random integer instead of random number.

Random number generates a number like 1.328397562134977 which will almost certainly never be equal to exactly 1 or exactly 2