#Question about Multiplayer for my map

8 messages · Page 1 of 1 (latest)

modest radish
#

Hello guys!

A question related to multiplayer for my map:

Is it possible to make players, when they exit the world,
so that when they re-enter the world, they do not appear at the point of their last location, but make them appear at the spawn point of the world.

(and not only that, anywhere at all, the main thing is that they do not appear at their last coordinates)

I hope this can be solved, since map makers will probably need it very much some times.

P.S. Don't forget to ping me, as I really need a solution to this issue for my map as soon as possible.

Minecraft Bedrock Version: 1.19.60.22 [Preview]

tawny sailBOT
#
Thanks for asking your question!

Once you have finished, please close your thread.

uneven lance
#

@modest radish Hello. You may absolutely detect when the player leaves the world, but teleporting them to the world spawn is another problem in and of itself.

#

If you know where the world spawn is beforehand, like if that were pre-determined, you could teleport the player to that location.

#

I mention that because this system would not be fully dynamic; if the world spawn were moved, the command that teleports players to it upon rejoining would need to be updated too.

#

But anyway, here's a code snippet of one way you could implement player join detection with commands:
Setup: /scoreboard objectives add connected dummy

scoreboard players add @a connected 0
teleport @a[scores={connected=0}] <position>
scoreboard players reset * connected
scoreboard players set @a connected 1
#

The key part of this system is how adding 0 to a player's score will not change its value, but will set the score to 0 if they otherwise do not have a value.

#

While a player is offline, running /scoreboard players reset * connected will reset their score, and when they reconnect it will be 0 the first time those commands are called.