Saving a Dimension ID

Started by Rugbeat90999 on

Topic category: Help with modding (Java Edition)

Last seen on 17:24, 14. Jan 2024
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Saving a Dimension ID

I'm making a mod where a player uses an item to enter a dimension. When you use it, your dimension is switched to my custom dimension, and if you use it in the custom dimension it takes you to your previous location.

The problem is that I can't find a way to save which dimension you used it in. So if I use it in the nether, then leave the custom dimension I end up in the overworld, suffocating under ground.

I need to be able to save the dimension they use it in, then send them back to their coordinates in that dimension, but there are no variables to save dimensions.

I also need it to be compatible with other mod's dimensions.