Place structure under player AFTER entering custom dimension?

Started by jmods on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Place structure under player AFTER entering custom dimension?

I'm trying to make it so when a player enters my custom dimension (which is just air, no blocks) a structure spawns at their feet preventing them falling out the world. I've tried to figure out and follow tutorials for global variables to store positions but just can't make it work. I'd appreciate any help, thanks

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could run a procedure…
Thu, 10/19/2023 - 00:34

You could run a procedure with the global trigger 'when entity enters dimension, then try to immedieately place your structure beneath the entity's current position. The problem you're running into is likely similar to the End, where loading in the entire dimension for the first time can delay the generation of the spawn platform, forcing the game to teleport the player up. 

But yeah, it's probably not as complicated as it seems. I would consider using the 'when entity enters dimension' trigger, then maybe adding in a brief delay of a couple ticks before loading the structure beneath the entity's current position. (Not the provided x/y/z coordinates, but the current x/y/z positions of the entity running the procedure.)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Thanks for the reply! I…
Fri, 10/20/2023 - 19:58

Thanks for the reply! I tried what you said and it's still not playing ball :(

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
If your entire dimension is…
Fri, 10/20/2023 - 20:02

If your entire dimension is air, and the player is always going to spawn at a specific location, you could try teleportation. ...Again, this'll only work if the dimension is designed in such a way that there's only one point the player enters, and you're returning them to their original location when they return to the overworld. (Probably again using player persistant variables and teleportation to keep track of their previous location in the overworld.) 

In this case, you could just teleport the player to 0,64,0, (or slightly higher, depending on what elevation you need the structure at), upon entering the dimension, and load the structure directly beneath them.