Jump to content

How to teleport a player into another world


iNehMan

Recommended Posts

The world in question is currently in a ZIP inside my JAR file. Is it possible to extract it and teleport the player to it? I've been thinking about extracting it to the saves folder, but I have no idea how to get the path to the player's .minecraft folder in-code.

Link to comment
Share on other sites

Maybe you could generate a specific Dimension of the wanted world (or all) into the new World. How this could be done, no Idea. But you could have a look at different world-generator Mod sources. This helps me often when I'm modding

If my English is not perfect it is not my fault! It's the fault of my teacher, parents, friends and google translator!

Link to comment
Share on other sites

You can get the world saves folder quite easily:

 

DimensionManager.getCurrentSaveRootDirectory();

That gives you the current world's folder, so one level up is the "saves" directory, and one level above that is the main ".minecraft" directory. As for unzipping it, the standard java.util.zip package contains the classes/methods you need to extract files.

 

Unloading the current world and loading the new one, though... that's beyond my scope of knowledge.

Whatever Minecraft needs, it is most likely not yet another tool tier.

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.



×
×
  • Create New...

Important Information

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