Saving Player Overworld Coordinates and using them in another Dimension.

Started by Squrikle on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Saving Player Overworld Coordinates and using them in another Dimension.

Hello, I am working on a mod that adds a new dimension. Instead of a portal, I have a block that you right-click to teleport. Whenever the player right-clicks the block it teleports the player to the world spawn coordinates rather than their current coordinates and vice-versa from the dimension to the overworld.

Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When the block is clicked…
Sat, 01/02/2021 - 20:16

When the block is clicked and the entity is in the overworld set a nbt variable to the position of the player. Call it overworldX , Y and Z. Teleport the player to dimX, dimY, dimZ

When the block is clicked and the entity is in your dimension set a nbt variable to the position of the player. Call it dimX, Y and Z

Teleport the player to overworldX, overworldY, overworldZ.