Change location of where portal spawn in dimension

Started by RedInventor on

Topic category: Advanced modding

Joined Mar 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Change location of where portal spawn in dimension

I am wanting to have the portal that goes to my custom dimension to spawn around a certain height. Portal spawn y > 250.

I am looking at the code but I am not sure what part that tells the game to spawn the portal at some y value.

Joined Aug 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can try something: Make…
Thu, 02/11/2021 - 15:49

You can try something:

Make a number global world variable that is put to 0, a .nbt file that contains only your portal and another structure of the size of your portal that contains only blocks you expect to spawn at the altitude where your portal spawns for the moment (air, rock, ect...)

When the player enters the dimension, make the game check if the varable is to 0.

If yes, put the variable to 1, spawn your portal structure at [X;250;Z], delete the old portal by placing your blank structure and teleport your player next to the new portal;

Else, do nothing.

It's a basic solution to spawn at Y=250 at the first enter in the dimension, but you can't use it for another portal. I will send a new message if I find a way to do that.