Custom portal mechanic is supposed to send player to surface Y level but is completely broken, how to make it work?

Started by _Ice_Lord_ on

Topic category: Help with MCreator software

Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Custom portal mechanic is supposed to send player to surface Y level but is completely broken, how to make it work?

To enter my dimension, I told my custom portal block to (on entity collide in the block) switch dimension of entity and change their position to [x [get world surface level at x z] z].

But the procedure does not send them to surface level in the destination dimension, sometimes they spawn in the air, and most often far below Y0 and die in the void.

I also tried telling it to wait some ticks in between switching dimensions and changing position but nothing changes.

Maybe it's getting the surface level of the source dimension rather than the target one, maybe it's getting the Y=0 "surface" before the chunks can load.

What could I do to teleport them to the surface Y level (see the sky) in the destination dimension?