maruohon / justenoughdimensions

A simple Minecraft mod to register custom dimensions to the game
GNU General Public License v3.0
12 stars 7 forks source link

Setting Up Dimensions to Ignore the Overworld #27

Open MokahTGS opened 6 years ago

MokahTGS commented 6 years ago

I'm trying to setup a modpack that has the player traveling through dimensions, but never actually going to the overworld. I have the player starting in the Betweenlands dimension and can travel to other modded dimensions. This is all working as intended except that if the player dies outside of the Betweenlands (for example, the Nether) they end up respawning in the overworld. This happens despite having set /jed setworldspawn command in dim 20 and having used a bed to set the player spawn.

How do you use JED to lock players out of the overworld?

I'd like to do several things:

  1. Reliably start the player at x0 y125 z0 in Dim 20.
  2. Allow the player to sleep in a bed in each custom dimension, setting their spawn where they see fit, even in the nether.
  3. Setup custom gamerules for every dimension, including the modded ones like the Betweenlands, Twilight Forest, etc.
  4. Guarantee that the player goes back to their set spawn point (bed) or the world spawn point of x0 y125 z0 in Dim 20 when they die.

Can I do all this with JED?

maruohon commented 6 years ago

The vanilla/JED setworldspawn command only sets the global spawnpoint of that dimension to that point. It doesn't actually have anything to do with changing/setting a respawn dimension. Specifying the respawn dimension is a little bit finicky, and that is one area that I want to improve in future versions still.

One thing first: are you on the 1.6.0 dev/alpha builds? I highly recommend those as they have countless improvements and additions over the old 1.5.x versions, and lots of the things I'm explaining next only work in the latest 1.6.0 dev versions. Just be aware of the few config format changes the 1.6.0 versions have from 1.5.x. There is a list of those here: https://pastebin.com/raw/28jeWZyv

As to your list of things:

Edit: Oh and also if you want the overworld to be useless, you can set it to be completely empty/void using a superflat preset, and then also optionally setting a "void_teleport" in JED such that any player that ends up in the overworld by any means would just immediately get teleported for example to DIM 20.

MokahTGS commented 6 years ago

I am using the latest builds for JED.

MokahTGS commented 6 years ago

My problem is I either don't understand how to setup the dimensions in the way you describe or a feature is missing and waiting on a future update.

Are these defined in game with commands or in separate json files? If so, is there a clear tutorial video somewhere? The Wiki has information but its not really clear for non-programers.

maruohon commented 6 years ago

All the JED dimension configuration is done via the config/justenoughdimensions/dimensions.json file. There are also in-game commands to do some of that via commands, but they can't do everything, and in general it is (in my opinion at least) a lot slower and more cumbersome to try to do it via those commands. So I'd recommend just doing it in a good text editor with syntax hilighting (for example Sublime Text, Atom or Notepad++).

Here is an example config for your use case, as far as I know what you want based on the first message. This example assumes that dimension 20 already exists, ie. is from some other mod. Also note that you will need to enable a few things in the main JED config (either in the config/justenoughdimensions/justenoughdimensions.cfg file or via the in-game config menu): at least enable dimension overriding, WorldInfo overrides, and the initial spawn dimension override, and also set the initial spawn dimension ID in there to 20, as that's what you wanted to spawn in?

Here is the config: https://pastebin.com/5EsfjVxK

This example enables respawning in the Nether, but the respawn stuff would still be a problem in some other dimensions, at least until I find the time to implement some of the planned respawn related improvements.

Edit: To clarify the last point: you can also enable respawning in other dimensions where by default you aren't able to respawn in, but that is (at least currently) only possible if you can override the registration of that dimension to use one of the JED WorldProviders. Whether or not you can do that depends on if it's a modded dimension that requires the use of their own WorldProvider for something.

MokahTGS commented 6 years ago

Ok, so this answers some questions, but its still not possible to do what I need until the respawn improvements are added. I couldn't just duplicate the nether section you pasted in the above example and change the dim id to match the other dimensions involved?

For my case I have the following dimensions: The Betweenlands - Dim 20 The Nether - Dim -1 The End - Dim 1 The Twilight Forest - Dim 7 The Beneath - Dim 10 The Erebus - Dim 66 The Aether - Dim 3 & 4 Thaumcraft - Dim -42 Dimensional Doors - Unsure of IDs but there are at least 3-4

I'm assuming your example is a version of a dimension.json file and not the config file. Since I don't see one in the JED config folder, I'm also assuming I make it from scratch.

maruohon commented 6 years ago

Yes the above is an example of the dimensions.json config file. And it never gets generated automatically, because it's even a valid configuration to use JED without it (for the initial spawn dimension override).

So if I understood it correctly, they way you would want respawning to work, is:

Would the "last slept-in-bed" be significant in this? So for example if the player sleeps in the Twilight Forest, would that cause them to not respawn in the Nether if they die in the Nether after that, without having slept in the Nether again? This is where the respawn stuff gets tricky, as the vanilla/Forge code doesn't really properly support controlling/overriding the respawn dimension, even in the PR I mentioned.

MokahTGS commented 6 years ago

Basically if player sleeps in a bed, that is where they respawn no matter what dimension its in. If there isn't a bed and they die in any dimension they get respawned at 0, 125, 0 in dim 20