Random numbers

Started by MrAppleSalad on

Topic category: Help with MCreator software

Last seen on 03:35, 25. Jun 2019
Joined Nov 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Random numbers

I made a procedure where when the mob dies one of two possible mobs is supposed to spawn in it's place. Thing is, while the code looks fine and the game launches fine i always get the same mob every time I kill it. It's an if else command with the two options being the 2 mob spawns and it's "if (random [0,1]) = (1)", i don't see why that shouldn't work. I can post a screenshot if need be.

Random [0,1) makes numbers…
Fri, 05/31/2019 - 17:33

Random [0,1) makes numbers between 0 and 0.999999, never 1. To make 70% chance, check if random value is smaller than 0.7.

https://www.youtube.com/watch?v=DZoNuidQ32M&list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei&index=23&t=303s

Last seen on 03:35, 25. Jun 2019
Joined Nov 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thank you so much! That…
Sat, 06/01/2019 - 18:19

Thank you so much! That worked beautifully!