LoadUp a Server without any default worlds

I got the following problem. A normal server startups with worlds like this:

  • World
  • DIM1
  • DIM-1

I want it to be like this:

  • Lobby (first world to join)
  • GameWorld

Problem is that unloading all the worlds and creating a new World causes crashes:

Please not that I would like to do this with code, no configuration files. Their will be a lot of these small servers and it would be a pain for those who manages them to disable all the worlds manually.

I do believe you could set enabled to false on the worlds in question. That’s suppose to prevent them from loading on startup.

These worlds will be created regardless - they are part of Vanilla minecraft and as far as I know there’s no way to prevent this.

However, you can prevent them from ever being loaded (and hence generated) through configs - these can also be changed programmatically through WorldProperties.

You can watch the ConstructWorldEvent and see when a world is first created - you can immediately use setEnabled(false) to prevent it from being loaded from that point onwards.

1 Like

If it’s about the name, you can rename “world” to whatever you like in the server.properties level-name=
But that’s just for one of those 3 worlds :smiley:

They don’t want to do it with configs

1 Like

The setEnabled is probably the best thing :smile:. We just don’t want these worlds to eat up tick time.

Just did some testing and ConstructWorldEvent doesn’t seem to get called. @Developers any idea?
I am using spongeforge: 3.1.0-BETA-115. And register the events on GameAboutToStartServerEvent.
It looks implemented tho:

@thomas15v Maybe you’re looking for LoadWorldEvent. I believe ConstructWorldEvent is used when a new world is being created (never generated before).

1 Like