Random Variables

Started by Mr_Alpha on

Topic category: Advanced modding

Active 3 years ago
Joined Jul 2015
Points:
880

User statistics:

  • Modifications: 6
  • Forum topics: 8
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 133
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.

Active 1 year ago
Joined Aug 2013
Points:
1163

User statistics:

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

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

Active 3 years ago
Joined Jul 2015
Points:
880

User statistics:

  • Modifications: 6
  • Forum topics: 8
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 133
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?

Active 3 years ago
Joined Jul 2017
Points:
726

User statistics:

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

Same question. PLZ HELP!

Active 3 years ago
Joined Jul 2017
Points:
726

User statistics:

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

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

Active 3 years ago
Joined Jul 2017
Points:
726

User statistics:

  • Modifications: 0
  • Forum topics: 2
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 42
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.