I am trying to create a mod that has a blacklist of servers and when a server is blacklisted show the player the option to join anyways or go back to the server list.
Currently i got the disconnected screen to show up, but the client does not disconnect from the server and the back to server list button does not work.
This is my current code:
Minecraft.getInstance().setScreen(new DisconnectedScreen(Minecraft.getInstance().screen, Component.literal("WARNING"),Component.literal(Minecraft.getInstance().getCurrentServer().ip +" is blocked.")));
And this is the result:
i already tried to create a Screen but that did not work. It would be awesome if i could get the DisconnectScreen working.