Chance Procedure not executing sometimes

Started by ohsnapitsWOLFIE on

Topic category: Help with MCreator software

Last seen on 05:08, 20. Mar 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Chance Procedure not executing sometimes

Hi, ive been working on a mod recently that when you use a certain GUI table, it will apply a random enchant to the item in one of the slots, i have the chance thing working, and it works fine, but sometimes it will just randomly not enchant anything onto an item, and there is no missing percentage in the randomizing (everything is a 0.25% chance of applying and there are four items, adding up to 1 (100%)).

Last seen on 00:04, 29. Mar 2024
Joined Apr 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
change it to: set custom…
Sat, 06/03/2023 - 16:52

change it to:

set custom variable to random0-1

if variable > .75

     do enchant 1

else if variable > .5

     do enchant 2

else if variable > .25

     do enchant 3

else

     do enchant 4

 

 

that will work.

Sorry for the late answer.