Get error "Invalid dimension id 2" when create new world

I want create a new world.

    WorldArchetype worldArchetype = WorldArchetype.builder().dimension(DimensionTypes.OVERWORLD).build("ww", "ww");
    try {
        WorldProperties worldProperties = Sponge.getServer().createWorldProperties("ww", worldArchetype);
        Sponge.getServer().loadWorld(worldProperties);
    } catch (IOException e) {
        e.printStackTrace();
    }

Why this code will given:

java.lang.IllegalArgumentException: Invalid dimension id 2
        at net.minecraft.world.DimensionType.lambda$getById$0(SourceFile:636) ~[avg.class:?]
        at java.util.Optional.orElseThrow(Unknown Source) ~[?:1.8.0_71]
        at net.minecraft.world.DimensionType.func_186069_a(SourceFile:636) ~[avg.class:?]
        at net.minecraft.world.WorldServer.<init>(SourceFile:121) ~[lw.class:?]
        at org.spongepowered.common.world.WorldManager.createWorldFromProperties(WorldManager.java:799) ~[WorldManager.class:1.11.2-6.1.0-BETA-6]
        at org.spongepowered.common.world.WorldManager.loadWorld(WorldManager.java:631) ~[WorldManager.class:1.11.2-6.1.0-BETA-6]
        at org.spongepowered.common.world.WorldManager.loadWorld(WorldManager.java:570) ~[WorldManager.class:1.11.2-6.1.0-BETA-6]
        at net.minecraft.server.MinecraftServer.loadWorld(SourceFile:3797) ~[MinecraftServer.class:?]
        at tw.mcark.tony.pluginlab.PluginLab.onGameInitialization(PluginLab.java:40) ~[PluginLab.class:?]
        at org.spongepowered.common.event.listener.GameStartedServerEventListener_PluginLab_onGameInitialization3.handle(Unknown Source) ~[?:?]
        at org.spongepowered.common.event.RegisteredListener.handle(RegisteredListener.java:95) ~[RegisteredListener.class:1.11.2-6.1.0-BETA-6]
        at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:349) [SpongeEventManager.class:1.11.2-6.1.0-BETA-6]
        at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:366) [SpongeEventManager.class:1.11.2-6.1.0-BETA-6]
        at org.spongepowered.common.event.SpongeEventManager.post(SpongeEventManager.java:370) [SpongeEventManager.class:1.11.2-6.1.0-BETA-6]
        at org.spongepowered.common.SpongeImpl.postState(SpongeImpl.java:198) [SpongeImpl.class:1.11.2-6.1.0-BETA-6]
        at org.spongepowered.server.SpongeVanilla.onServerStarting(SpongeVanilla.java:163) [SpongeVanilla.class:1.11.2-6.1.0-BETA-6]
        at net.minecraft.server.dedicated.DedicatedServer.handler$callServerStarting$zoe000(SourceFile:1249) [lh.class:?]
        at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(SourceFile:229) [lh.class:?]
        at net.minecraft.server.MinecraftServer.run(SourceFile:436) [MinecraftServer.class:?]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_71]

I don’t see anyway can change dimension id. Why?

Sponge Version: SpongeVanilla version 1.11.2-6.1.0-BETA-6

Not sure if this will help, but you can try the method
“.from(WorldArchetypes.OVERWORLD)”

instead of

“.dimension(DimensionTypes.OVERWORLD)”

Still no, further more, even use Project Worlds will get same result. Consider it’s a bug?

  1. Start a new server
  2. Install Project Worlds
  3. /world create w123
  4. /world load w123
  5. same issue occurred

/world properties w123
Output:

It could definitely be. I’m having problems with WorldGenerators too and it could be a related issue. Unfortunately I’m not really the guy to determine that.

It is definitely a known bug in the spongevanilla series for a while, but appears to have had a fix made very recently for the bleeding-7.0.0 api versions that may or may not have been merged yet.

1 Like

I bump this topic because I updated to sponge API 7 and here is what I get : ---- Minecraft Crash Report ----// Would you like a cupcake?Time: 6/10/17 - Pastebin.com

What can I do for this chunk ? Going on it and hard delete it ?

Edit : Went there, deleted chunk, same crash error.

Thats something quite different, and not related to the dimension problem.
It should be addressed as its own issue.

If you use the seed for the map on a spongeforge server with no other mods /plugins, do you get the same issue (intrinsically, the mansion generator having problems populating the map). If not, then wipe the map files, and add one plugin at a time back until you get the same error again - it may be something hooking into the generator code in order to enhance things within the structures, beef up chest contents or such if it can be isolated to a plugin cause. Though most of your plugins being permission and chat related probabably can be safely stroked off as culprits, nucleus does have map-generating stuff… Worldedit and FAWE are are generally passive and wouldn’t be linked to it, but shouldn’t be overlooked.

If its a pure-server cause, then having the seed value for replicating and observing the bug will be critical. (Also note, if its a plugin that is identified, contacting its author with the seed and location as well would be prudent)

1 Like

Great, I will investigate with your advices. Thanks for repyling :slight_smile: