Use World Seed

Started by GamerGoat56 on

Topic category: Help with MCreator software

Last seen on 19:17, 14. May 2022
Joined Jan 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use World Seed

Hey!  I was wondering whether it was possible to use the world seed as the seed to randomize variables so that the variable is the same every time the world is generated, but different for each world; and if so, how?  Thanks for any help in advance!

Last seen on 17:41, 7. Dec 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I found this, for 1.18.2: …
Thu, 07/21/2022 - 12:36

I found this, for 1.18.2:

 world.getServer().getWorldData().worldGenSettings().seed()

It returns current world's seed in a variable of type Long.

Use a Custom code snippet.

 

 

If you want to convert it to a variable of type Int or Double, DON'T do this:

(int)(world.getServer().getWorldData().worldGenSettings().seed())
(double)(world.getServer().getWorldData().worldGenSettings().seed())

It will return a different value to your seed.
Instead, first convert the Long variable to a String, and then parse it.

Int.ParseInt(world.getServer().getWorldData().worldGenSettings().seed() + "")
Double.ParseDouble(world.getServer().getWorldData().worldGenSettings().seed() + "")

I hope this is helpful to you.

Last seen on 17:41, 7. Dec 2023
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Sorry, it's not Int.ParseInt…
Thu, 07/21/2022 - 17:43

Sorry, it's not Int.ParseInt() or Double.ParseDouble(). It's Integer.parseInt() and Double.parseDouble()

Last seen on 21:54, 16. May 2024
Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ShadowGriff872 does this…
Sun, 12/03/2023 - 23:29

ShadowGriff872 does this work for Mcreator 2023.2? If so, how do I make it work?