Randomizing

Started by Benoniusthecat on

Topic category: Help with Minecraft modding (Java Edition)

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Randomizing
Sat, 09/21/2019 - 17:24 (edited)

I was thinking about making a kind of radio receiver thing that when used, will give you a random message with help on the mod, but how could I randomize it? If you have a solution, let me know! (NOTE: I am not wanting this to be a block)

Edited by Benoniusthecat on Sat, 09/21/2019 - 17:24
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
https://www.youtube.com…
Sat, 09/21/2019 - 12:03

https://www.youtube.com/watch?v=SBtTsNYiHzw

If you don't want a 50/50 randomiser but want to have, say 5 messages of which 1 has to appear at random: 1/8 = 0.125.PROCEDURE:


Set random_local_variable to random[0,1]

if random_local_variable < 0.125

do message 1

else if random_local_variable < 0.125 * 2

do message 2

else if random_local_variable < 0.125 * 3

do message 3

else if random_local_variable < 0.125 * 4

do message 4

else

do message 5

 

Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
EDIT: the 0.125 was meant…
Sat, 09/21/2019 - 12:04

EDIT: the 0.125 was meant for 8 results. change that number to 1/5 = 0.2

I suggest you check our…
Sat, 09/21/2019 - 13:00

I suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks! This worked after a…
Sat, 09/21/2019 - 19:16

Thanks! This worked after a few tries and I really like the result!