How do I get the entity position after a dimension change?

Started by DerexXD on Sun, 09/22/2019 - 20:11

Topic category: Help with modding

Last seen on 19:20, 5. Feb 2020
Joined Jan 2016
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
How do I get the entity position after a dimension change?
Sun, 09/22/2019 - 20:11

I have a block that takes you to another dimension when right clicked

However, I want to make sure they do not suffocate so I made two add block at the entity position, they both add air

But this is only adding the blocks it to the overworld coordinates, not the new ones in the other dimension. Any help? 

0Upvote this forum topic
Last seen on 13:23, 2. Oct 2019
Joined May 2017
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
the x y and z values in the…
Mon, 09/23/2019 - 13:25

the x y and z values in the new dimension should be the same, just make sure the actual procedure is being called in the new dimension and not the overworld

0Upvote this forum topic
Last seen on 08:56, 26. Dec 2019
Joined Jan 2017
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
As seph said, you have the…
Mon, 09/23/2019 - 13:43

As seph said, you have the call the dimension first, then set it to air.

0Upvote this forum topic
Last seen on 19:20, 5. Feb 2020
Joined Jan 2016
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
yes, I'm calling the…
Mon, 09/23/2019 - 23:49

yes, I'm calling the coordinates after they move dimensions though 

0Upvote this forum topic
Last seen on 21:42, 5. Dec 2019
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
Hey Derex. You can do this…
Tue, 09/24/2019 - 20:30

Hey Derex. You can do this through:

OnBlockRightClicked:

Switch dimension for provided (entity)player to [ID]

Set entity data logic NBT tag to "JustTeleportedToID"
OnPlayerUpdateTick:

If Get entity data logic NBT tag "JustTeleportedToID" = true AND Get dimension id of provided world [ID]

do Place air at x y z

do Place air at x y+1 z

do Set entity data logic NBT tag "JustTeleportedToID" to false.

You wont be teleported to the same coordinates however, but you can if you simply store the player coordinates in NBT tags and teleport the player there, then playing the second procedure.

0Upvote this forum topic
Last seen on 21:42, 5. Dec 2019
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
OnBlockRightClicked: Switch…
Tue, 09/24/2019 - 20:32
OnBlockRightClicked:

Switch dimension for provided (entity)player to [ID]

Set entity data logic NBT tag "JustTeleportedToID" to true

correction*

0Upvote this forum topic
Last seen on 21:42, 5. Dec 2019
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
Additionally, you might want…
Tue, 09/24/2019 - 20:39

Additionally, you might want to delete 4 blocks of air as you are spawned at the vertices of a block and not in the middle. Hope that helps.

0Upvote this forum topic
Last seen on 19:20, 5. Feb 2020
Joined Jan 2016
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
ok i'll try that 
Tue, 09/24/2019 - 22:36

ok i'll try that 

0Upvote this forum topic