I didn't know of a MCreator way of getting the spawn coordinates of a player, so I used some commands (the first three blocks of the procedure). They are in this form:
execute store result entity @s ForgeData.spawnX int 1 run data get entity @s SpawnX
where the X is either X, Y, or Z depending on which coordinate it's getting. Make sure you put X, Y, and Z into 3 separate commands so that you can get all three values you need.
I put the override fall distance block there so that if the player was falling before they used the item they didn't splat into the ground and take damage when they respawned. Here is a new procedure that should work better:
This one also checks wether or not the player has set their spawn point yet, and if not, it sends them to the world spawnpoint. The new command that is in the first block is:
execute store success entity @s ForgeData.hasSpawn byte 1 run data get entity @s SpawnX
What are all the commands used here, sorry? You can't see all the text in each of the boxes. Are the other commands the same as the first, just replacing 'success' with 'result'?
execute store success entity @s ForgeData.hasSpawn byte 1 run data get entity @s SpawnX
execute store result entity @s ForgeData.spawnX int 1 run data get entity @s SpawnX
execute store result entity @s ForgeData.spawnY int 1 run data get entity @s SpawnY
execute store result entity @s ForgeData.spawnZ int 1 run data get entity @s SpawnZ
I don't know anyway to get the spawnDimension, since unlike the spawn position, it is not stored in the player's nbt data (as far as I can tell). This unfortunately means that the magic mirror does not work correctly if you are not in the spawn point's dimension, which you can't seem to check.
from what i know, there is a SpawnDimension NBT tag stored in the player data. if you could get it the same way you do with the SpawnX SpawnY and SpawnZ the magic mirror could theoretically work in any dimension that the player's spawn is set in, making it mod compatible
You need one procedure on right click to tp to spawnpoint.
I highly suggest you check our tutorials collection playlist on our YouTube channel which contains many examples and tutorials that can help you get started with MCreator: https://www.youtube.com/playlist?list=PLAeL-oIFIEngE6jRgFYeFMfuj8WQsO3Ei
ive watched all of them and none don't help me in this area. You kinda just answered my question with my question. What procedures do I use?
Here's a procedure that should do what you want:
https://drive.google.com/file/d/1U2WZbfI9CQONhPylz40ukfxi48vtATVv/view?usp=sharing
I didn't know of a MCreator way of getting the spawn coordinates of a player, so I used some commands (the first three blocks of the procedure). They are in this form:
execute store result entity @s ForgeData.spawnX int 1 run data get entity @s SpawnX
where the X is either X, Y, or Z depending on which coordinate it's getting. Make sure you put X, Y, and Z into 3 separate commands so that you can get all three values you need.
Thank you so much
Whats the override fall distance for?
It works, but only for the second time i teleport, the first time sends me to 0 0 0, then i right click again and i got home
I put the override fall distance block there so that if the player was falling before they used the item they didn't splat into the ground and take damage when they respawned. Here is a new procedure that should work better:
https://drive.google.com/file/d/1IXZ_FC5fSl4OlubYX2raDwVI9Lnl8pc_/view?usp=sharing
This one also checks wether or not the player has set their spawn point yet, and if not, it sends them to the world spawnpoint. The new command that is in the first block is:
execute store success entity @s ForgeData.hasSpawn byte 1 run data get entity @s SpawnX
This is honestly amazing and I couldn't be more grateful!!! It works perfectly.
What are all the commands used here, sorry? You can't see all the text in each of the boxes. Are the other commands the same as the first, just replacing 'success' with 'result'?
Also how would you get the spawnDimension data?
The four commands used in the second version are:
I don't know anyway to get the spawnDimension, since unlike the spawn position, it is not stored in the player's nbt data (as far as I can tell). This unfortunately means that the magic mirror does not work correctly if you are not in the spawn point's dimension, which you can't seem to check.
from what i know, there is a SpawnDimension NBT tag stored in the player data. if you could get it the same way you do with the SpawnX SpawnY and SpawnZ the magic mirror could theoretically work in any dimension that the player's spawn is set in, making it mod compatible
It seems as though the SpawnDimension nbt tag is only created after the player has set their spawn
meaning in all other cases the magic mirror should just send you to overworld spawn??
for reference, i used the following command:
/execute store success entity @s ForgeData.spawnDimension byte 1 run data get entity @s SpawnDimension