Just Enough Dimensions

Just Enough Dimensions

4M Downloads

Setting Up Dimensions to Ignore the Overworld

MokahTGS opened this issue ยท 7 comments

commented

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?

commented

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:

  • You can use the "disable_teleporting_to": true option for the overworld to disallow any teleportation methods that respect the Forge events
  • You can use the initialSpawnDimension option in the main config to set the initial spawn dimension ID
  • You can use the worldinfo_onetime object with the SpawnX, y and z options to set a fixed spawn point in dimension 20
  • Then also set the spawnRadius gameRule to 0 to disable the spawn fuzz algorithm, forcing the respawn to happen at that exact spawn point
  • Currently, if you want to control sleeping and being able to respawn in a dimension, you need to use a JED WorldProvider for that dimension. The behaviour/control of the sleeping and respawning stuff is planned to be improved in an upcoming version.
  • Basically the two options for this are currently the CanRespawnHere and the RespawnDimension JED options. Note that "CanRespawnHere": false currently causes the bed to explode if a player tries to sleep in it. This will change in an upcoming version, as Forge recently included my PR to better separate that logic. The way this works, is that if CanRespawnHere is true, then the player will respawn in that same dimension if they die. If it's false, then they will respawn in the dimension set in the RespawnDimension option (and a bed would explode if tried to sleep in).
  • Setting custom GameRules per-dimension is done inside the worldinfo_onetime object in the config. Example: https://pastebin.com/Z04JQWfL

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.

commented

I am using the latest builds for JED.

commented

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.

commented

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.

commented

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.

commented

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:

  • The player can sleep in any dimension
  • If the player has slept in a bed in a given dimension, they would respawn there if they die in that dimension
  • If the player dies in a dimension where they haven't slept in a bed, they would respawn in DIM 20's spawn?

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.

commented

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