1
I need help with /spawnpoint!
Ok so in Minecraft 1.12.2 when you teleported someone somewhere and had a chain command block that had /spawnpoint @p in it after the command block that teleported them to that area, it set their spawnpoint to the area they were teleported to, but now in 1.13 it seems this doesn't work anymore and when the player dies they are greeted by a your home bed was missing or obstructed message when they respawn. What's supposed to happen is the player is supposed to respawn at the place they were originally teleported to. WHAT HAPPENED?!?
Create an account or sign in to comment.
3
2
This behavior hasn't really changed though. I think you've been using the wrong command(s) and are now discovering the results of that.
For example: /spawnpoint @p means that you'd set the spawnpoint for the nearest player. So unless the command blocks were actually at that same location where the players got teleported to then this wouldn't work right. It could also glitch if there are multiple players involved.
So.. on 1.12.2 I'd do something like this:
But like I said: 1.13 hasn't changed anything here. Well, apart from an easier to use tag command, and fo course: you can no longer use a slash in a command block:
However... You could also consider to use a function, that is probably a whole lot cleaner and it is much less prone to errors. 1.13 makes that especially easy with using datapacks.
So, for example, create a function which contains only this:
tp @s 10 64 10
spawnpoint @s
Then, at the location where you want to initiate the teleport, use a regular command block which uses this:
execute as @p run function yourserver:game/tp-player
This would imply a namespace "yourserver" in the datapack which contains a folder 'game' and the file "tp-player.mcfunction" in it.
So basically: datapacks/yourdatapackfolder/data/yourserver/functions/game/tp-player.mcfunction.
Hope this helps.
For example: /spawnpoint @p means that you'd set the spawnpoint for the nearest player. So unless the command blocks were actually at that same location where the players got teleported to then this wouldn't work right. It could also glitch if there are multiple players involved.
So.. on 1.12.2 I'd do something like this:
- /scoreboard players tag @p add totp
- /tp @a[tag=totp] 10 64 10
- /spawnpoint @a[tag=totp]
- /scoreboard players tag @a[tag=totp] remove totp
But like I said: 1.13 hasn't changed anything here. Well, apart from an easier to use tag command, and fo course: you can no longer use a slash in a command block:
- tag @p add totp
- tp @a[tag=totp] 10 64 10
- spawnpoint @a[tag=totp]
- tag @a[tag=totp] remove totp
However... You could also consider to use a function, that is probably a whole lot cleaner and it is much less prone to errors. 1.13 makes that especially easy with using datapacks.
So, for example, create a function which contains only this:
tp @s 10 64 10
spawnpoint @s
Then, at the location where you want to initiate the teleport, use a regular command block which uses this:
execute as @p run function yourserver:game/tp-player
This would imply a namespace "yourserver" in the datapack which contains a folder 'game' and the file "tp-player.mcfunction" in it.
So basically: datapacks/yourdatapackfolder/data/yourserver/functions/game/tp-player.mcfunction.
Hope this helps.
1
1.13 has not been officially released yet, therefore I would recommend you wait untill it has been officially released :)
2
Nah, they already announced a feature stop several weeks ago, and pre-release 3 got out last week. Pre-release means basically that it's pretty much the official release except for some possible left over bugs.
Even so, you really don't have to worry too much about heavily changing features anymore.
Even so, you really don't have to worry too much about heavily changing features anymore.