Random Variables

Started by Mr_Alpha on

Topic category: Advanced modding

Joined Jul 2015
Points:

User statistics:

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

Hi everyone,

 

I'm trying to create a mod where if you type in a command it tells you to pick a number one through ten. I want it to then randomize a whole number 1-10, but there's not button to set a variable to random # - #. Does anyone know how to do this?

 

Thanks.

Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Something like Math.round
Wed, 03/23/2016 - 23:59

Something like Math.round(Math.random()*10)

Joined Jul 2015
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
RE:Something like Math.round
Thu, 03/24/2016 - 14:03

@#1 Would I have to put that in custom code? Like, go to the set variable menu and then where it asks what to set it to, type Math.round(Math.random()*10)? And I thought Math.random was used as Math.random(x) to pick a number from 1 to x?

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Same question. PLZ HELP!
Wed, 01/24/2018 - 14:25

Same question. PLZ HELP!

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm making random mob drops…
Wed, 01/24/2018 - 14:31

I'm making random mob drops and i need help D:

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
3 months ago I was hoping…
Mon, 03/05/2018 - 02:44

3 months ago I was hoping someone would answer. Now I'm just bored.