#Stuck on "Locating Server"

1 messages · Page 1 of 1 (latest)

static scroll
#

Log out while chunks are not loading (you can achieve this by teleporting across worlds multiple times, using a low-end device, have a bad internet connection, simulate lag by setting low tick etc.) and try to join back. You will be stuck on "Locating Server" until you eventually time out.

Teleporting the stuck player to a generated chunk will allow them to join back again.

regal hamlet
#

I'm also getting stuck on Locating Server alot, I dont even know the reason why because I randomly get it

hallow oxide
#

actually @static scroll ur code in dms fixed that on me

static scroll
hallow oxide
#

well - i'm happy with that

#

but yeah ur right

#

alright imma fix this

static scroll
regal hamlet
static scroll
# regal hamlet can you also give me this code so I can have a temp fix for now

This will teleport all players on login to a specific location.
Add this to a class implementing Listener and change the position you want to teleport the player to on join.

    @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
    public void on(PlayerPreLoginEvent event) {
        final Server server = Server.getInstance();

        final UUID uuid = Server.uuidFromXUID(event.getIdentityClaims().extraData.xuid);

        final Position spawn = new Position(0.5, 125.1, 0.5, server.getDefaultLevel());

        if (server.hasOfflinePlayerData(uuid)) {
            final CompoundTag nbt = server.getOfflinePlayerData(uuid);
            nbt.putString("Level", spawn.getLevel().getName())
                    .putList("Pos", new ListTag<DoubleTag>()
                            .add(new DoubleTag(spawn.x))
                            .add(new DoubleTag(spawn.y))
                            .add(new DoubleTag(spawn.z)));
            server.saveOfflinePlayerData(uuid, nbt, false);
        }
    }

This snippet is for API 3.0.0 (latest nightly build)

vale cloak
#

Is this still a thing?

hallow oxide
#

probably

#

but the code up fixes it

vale cloak
#

You should respawn where you disconnected

hallow oxide
#

yeah thats why we didn't PR it actually

#

just a temporary one

static scroll
#

notable, if you teleport to a different world and the chunks don't load and log out, the bug will occur and the login location shows the coordinates of where you've been stuck in the world you wanted to teleport to but the world is the one you teleported from.

vale cloak
#

Anyone knows how to reproduce it?

static scroll
#

other than that it seems random

static scroll
#

Thank you buddel, I hope it works