This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
forked from Minestom/Minestom
-
Notifications
You must be signed in to change notification settings - Fork 36
[1.20.4] FakePlayer not spawning #94
Comments
With this piece of code I log all player in PLAY and CONFIGURATION state: MinecraftServer.getSchedulerManager().scheduleTask(() -> {
System.out.println("MinecraftServer.getConnectionManager().getOnlinePlayers().size() = " + MinecraftServer.getConnectionManager().getOnlinePlayerCount());
for (Player player : MinecraftServer.getConnectionManager().getPlayers(ConnectionState.PLAY, ConnectionState.CONFIGURATION)) {
System.out.printf("player = %s, state = %s%n", player.getUsername(), player.getPlayerConnection().getClientState());
}
}, TaskSchedule.immediate(), TaskSchedule.tick(20)); Now, I get my fake player in state HANDSHAKE but when I get I query only PLAY and CONFIGURATION state ?
Anyway, It seems my fake player stuck in HANDSHAKE state. |
mworzala
added a commit
that referenced
this issue
Jan 16, 2024
Should be fixed now. Note that you should not call setInstance in the spawn callback. FakePlayers go through the normal config->play sequence meaning you should use the config event to configure the spawning instance. |
mworzala
added a commit
that referenced
this issue
Jan 16, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I've updated to version 1.20.4 via a self-built minestom-ce on the 1_20_4 branch.
I try to make a FakePlayer appear with:
So, e is printed
e = net.minestom.server.event.player.PlayerSpawnEvent@7926d4ab
.But fp is not printed and the fake player does not appear.
The text was updated successfully, but these errors were encountered: