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 MCreator modding

Last seen on 02:42, 11. Oct 2019
Joined Jan 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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? 

Last seen on 13:23, 2. Oct 2019
Joined May 2017
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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

Last seen on 07:05, 12. Oct 2019
Joined Jan 2017
User points:

Statistics:

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

Last seen on 02:42, 11. Oct 2019
Joined Jan 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
yes, I'm calling the…
Mon, 09/23/2019 - 23:49

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

Last seen on 23:33, 13. Oct 2019
Joined Aug 2019
User points:

Statistics:

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

Last seen on 23:33, 13. Oct 2019
Joined Aug 2019
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
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*

Last seen on 23:33, 13. Oct 2019
Joined Aug 2019
User points:

Statistics:

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

Last seen on 02:42, 11. Oct 2019
Joined Jan 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
ok i'll try that 
Tue, 09/24/2019 - 22:36

ok i'll try that