Jump to content

[SOLVED] where do I get Random rand for MC seed to use anywhere?


trollworkout

Recommended Posts

I wanna keep predictability same where can I get the Random object for minecraft?

 

I know there is one RANDOM that forge makes  but I think is private to the Block only

 

Also I wanna use it in TileEntity

Disclaimer:  I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.

Link to comment
Share on other sites

World#rand

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Wait, what exactly do you want to do?

 

Even if you use the world Random with a specified seed, it doesn't necessarily provide predictability in the rest of the game unless you use it only during world generation. In other words, if you use it later in the gameplay you won't know how many other things have called for random numbers.

 

If you want your own sequence of pseudo-random numbers with a controlled seed I personally would generate my own custom Random sequence.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

World#rand is already initialized.  Just call nextInt on it.

 

If you want your OWN seed, then create a Random in your main mod class, if you're really super desparate, you could subscribe to the world-load event and initialize that Random to the world's seed.

 

Like...what's your use-case here?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I used World.rand as suggested works perfect ! thanks

 

int chance = worldIn.rand.nextInt(100) to get a percentage

if (chance < 20)  //20%

blah blah 1

else if (chance < 40) //20%

blah blah 2

 

works perfect thanks!

Disclaimer:  I been told to keep my opinions to myself, to shut up and that I am spreading lies and misinformation or even that my methods are unorthodox and or too irregular. Here are my suggestions take it or leave it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.