1

I need help with /spawnpoint!

TheEpicMapMaker's Avatar TheEpicMapMaker6/24/18 11:18 am
1 emeralds 271 3
6/25/2018 3:04 am
ShelLuser's Avatar ShelLuser
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?!?
Posted by TheEpicMapMaker's Avatar
TheEpicMapMaker
Level 23 : Expert Nerd
7

Create an account or sign in to comment.

3

2
06/25/2018 3:02 am
Level 57 : Grandmaster Engineer
ShelLuser
ShelLuser's Avatar
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:
  • /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
I'd probably set the teleport command into a repeating command block and then place conditional chain command blocks behind it. The scoreboard tag command can then be used to initiate the transfer.

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
Same as before: use the tp command in a repeating command block and place conditional chain command blocks behind it.

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
06/24/2018 4:48 pm
Level 67 : High Grandmaster Senpai
Stubbs1
Stubbs1's Avatar
1.13 has not been officially released yet, therefore I would recommend you wait untill it has been officially released :)
2
06/25/2018 3:04 am
Level 57 : Grandmaster Engineer
ShelLuser
ShelLuser's Avatar
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.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome