This mod provides a lightweight way for servers to transfer players to another server address, without the use of a proxy server.
This mod provides a lightweight way for servers to transfer players to another server address, without the use of a proxy server.
Server Redirect supports Forge, Fabric, Bukkit/Spigot, SpongeVanilla/SpongeForge, Bungeecord/Waterfall and Velocity.
With Server Redirect, server admins can avoid mod incompatibility issues caused by proxy servers (Bungeecord, Waterfall, and Velocity). In particular, this mod can be used in combination with Waterfall and Forge 1.13+ servers and clients to provide a way to transfer players between servers (currently, the 1.13+ Forge server needs to be "online" as they haven't included IP forwarding yet...).
This mod is optional, so it can be added to modpacks and players can still join servers without this mod. Likewise, servers with this mod can be joined by clients without this mod.
The command source can be anything that can run a command, like a command block, a player, or console. Replace /redirect with /fallback to have the specified target players connect to the specified server address when they get forcefully disconnected from the server.
NOTICE: /ifplayercanredirect and /ifplayercannotredirect will likely not work as expected if run when the target player just joined the server. These commands rely on the client sending a packet to the server telling them they have this mod installed. This packet requires some time to be sent by the client and processed by the server. It is recommended to delay this command execution by at least 20 ticks after the player has joined the server!
Replace /redirect with /fallback for setting a fallback address for the target players. For more info about the fallback command, read below.
Any server address that is reachable by the players with the "Direct Connect" button can be used.
The "transfer" packet will not affect players without the mod installed: they will simply stay connected on the current server.
This behaves like the transfer packet present in "Minecraft: Bedrock Edition", feature included by Mojang by default on that client. Regrettably, "Minecraft: Java Edition" is missing this feature entirely.
Both the redirect and fallback commands are not supposed to be run by players. They are intended for being run by the console, command blocks and other plugins. Command aliases and "server selector" GUIs are recommended (see BossShop or VirtualChest).
The fallback command tells the clients which server address they should connect to in case they get forcefully disconnected from the server (e.g. the server crashes).
Server admins want to use this by running the fallback command automatically by the server for every player that joins the server. If the server shuts down for any reason, the players will automatically direct connect to the fallback server address specified in the fallback command.
Another use of the fallback feature is when you want to redirect a player to a server, but they might get rejected for some reason (e.g. the server is offline). First, set the fallback address for the player to a server address you can be sure they can reach, then use the redirect command to redirect the player to the server address they might get rejected from. If the player cannot join the server they were redirected to, they'll automatically join the fallback server.
Forge mods don't always expect that the player is being moved from one server to another, and when a proxy transfers a player to a different server, it can cause glitches or crashes. Forge mods commonly expect to be disconnected from the server before connecting to another one. Additionally, Forge 1.13+ does not support proxies server switching. This mod solves the issue by properly disconnecting players from the server, and then connecting them to another server. This way, mods can properly handle players switching from a server to another.
Server admins can also use a combination of a proxy and Server Redirect if they want to use all the other features proxies can provide (except on Forge 1.13+ servers currently). Still, it is suggested to look into replacing the proxy with cross-server plugins and mods.
Any combination of presence/absence of this mod will let players connect to servers. Players with this mod can connect to Vanilla servers as well, and players with vanilla Minecraft can also connect to servers with this mod.
Feel free to add this modpack in public and private modpacks. Asking for permission is not required. If you add Server Redirect to your public modpack, feel free to let everyone know in the comments below! Although this mod shouldn't have any conflict with any other mod, feel free to report conflicts here.
This project is MIT licensed. Feel free to fork this project and/or suggest new features on the Issues page! If you cannot find the right version of Server Redirect for your Minecraft version, feel free to ask there!
If you wish to buy me a pizza, click here! I appreciate it very much! :)
Conversation