Saving Player Overworld Coordinates and using them in another Dimension.

Started by Squrikle on Sat, 01/02/2021 - 19:52

Topic category: Help with modding (Java Edition)

Last seen on 01:56, 17. Apr 2021
Joined Oct 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Saving Player Overworld Coordinates and using them in another Dimension.
Sat, 01/02/2021 - 19:52

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.

Last seen on 19:49, 3. Nov 2021
Joined Nov 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.