Server Redirect
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.
Downloads
Player clients (Forge and Fabric)
- Download the latest Forge or Fabric version for your specific Minecraft version
- Put the downloaded jar file in your "mods" folder
Server admins
Plugin for Spigot (including Cauldron/Mohist), Sponge, Bungeecord and Velocity
- Download the latest Plugin version of this project
- Put the downloaded jar file on your server's "plugins" folder
Mod for Forge and Fabric servers
- Download the latest Forge or Fabric version for your specific Minecraft version
- Put the downloaded jar file on your server's "mods" folder
Pixelmon Reforged 9.0.0+ (Minecraft 1.16.5) includes the Server Redirect mod, so you cannot add the Server Redirect mod jar file otherwise you will get a duplicate mod error!
Commands
- /redirect <Target> <Server Address>: redirects the specified target player(s) to the specified address
- /fallback <Target> <Server Address>: sets the fallback server address for the specified target player(s)
- /ifplayercanredirect <Target> <Command...>: runs the specified command for each of the target player(s) that have Server Redirect
- /ifplayercannotredirect <Target> <Command...>: runs the specified command for each of the target player(s) that have not Server Redirect
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.
The <Target> argument can be one of the following:
- Player Name/UUID: the specified player on the server
- Target Selector: a target selector. Target selectors are not available on Bungeecord and Velocity.
- r=N: all players within N blocks from the command sender, or from the overworld spawn if run by console. Plugin version only.
- s=<ServerName>: all players in the specified ServerName. Bungeecord and Velocity only.
- *: all players on the server.
The <Command...> argument can contain the following placeholders:
- %PlayerName: this placeholder will be replaced with the player's name
- %PlayerId: this placeholder will be replaced with the player's UUID
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!
Examples:
- /redirect KaiNoMood myawesomemcserver.net:25667: the player named KaiNoMood will connect to myawesomemcserver.net:25667
- /redirect a54a7884-9ea4-4d54-ac35-1623d70ffbe1 myawesomemcserver.net:25667: the player with the specified UUID will connect to myawesomemcserver.net:25667
- /redirect * myawesomemcserver.net:25667: all players on the server will connect to myawesomemcserver.net:25667.
- /redirect @a[m=creative] myawesomemcserver.net:25667: all players in creative mode will connect to myawesomemcserver.net:25667.
- /redirect r=10 myawesomemcserver.net:25667: all players within 6 blocks from the command sender will connect to myawesomemcserver.net:25667. This works on Bukkit and Sponge based servers only.
- /redirect s=lobby myawesomemcserver.net:25667: all players in the "lobby" server will connect to myawesomemcserver.net:25667. This works on Bungeecord and Velocity proxy servers only.
- /ifplayercanredirect * say %PlayerName is online and using Server Redirect! Yay!: the specified command will run for each player on the server that has Server Redirect.
- /ifplayercannotredirect @a[distance=..5] tell %PlayerName It does not seem you have Server Redirect installed! Make sure to install it!: the specified command will run for all players without Server Redirect within 5 blocks of the command source.
Replace /redirect with /fallback for setting a fallback address for the target players. For more info about the fallback command, read below.
Permissions
- /redirect: serverredirect.command.redirect
- /fallback: serverredirect.command.fallback
- /ifplayercanredirect: serverredirect.command.ifplayercanredirect
- /ifplayercannotredirect: serverredirect.command.ifplayercannotredirect
These permissions are not supposed to be granted to players. These are console/command blocks commands only.
These permissions are valid for the plugin version only.
PlaceholderAPI
The plugin supports PlaceholderAPI (currently, Bukkit/Spigot only).
Placeholders:
- {serverredirect}: 1 if the player has Server Redirect, 0 otherwise
- {serverredirect_yesno}: "Yes" if the player has Server Redirect, "No" otherwise
- {serverredirect_yesnof1}: "&aYes" if the player has Server Redirect, "&cNo" otherwise
- {serverredirect_yesnof2}: "§aYes" if the player has Server Redirect, "§cNo" otherwise
Depending on the PlaceholderAPI version and configuration, you might have to use %serverredirect% instead of {serverredirect}.
FAQ
How this mod redirects players
- By running the /redirect command, the server will send a "transfer" packet containing the specified server address to the specified players.
- All players receiving the packet that have the ServerRedirect mod installed will disconnect from the server, and automatically direct connect to the specified server address.
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).
What the fallback command is for
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.
Reasons for using this mod instead of a proxy like Bungeecord, Waterfall or Velocity
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.
Players with this mod can join servers without this mod
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.
This mod can be added in modpacks
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.
License and improvements to the project
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! :)
Hey there @KaiNoMood! This is exactly the mod that I was looking for, however I need it for Fabric 1.17.1 :(
Any chance you could port it to Fabric 1.17.1?
I'm willing to pay too if needed.
Let me know!
In reply to Chesvin1:
Hey I can port it to Fabric 1.17.1, no problem. If you wish to buy me a pizza, click here! I appreciate it very much! :)
In reply to KaiNoMood:
Thank you so much, will try it later!!! Was going to but it says it can't find the profile in the link you sent me. Could you send me the email of your paypal instead?
https://gyazo.com/68caf20f95892b003f0b59aedc3adc8c
In reply to Chesvin1:
No problem! If you still wish to buy me a pizza, the link should be working now! Sorry about that!
In reply to Chesvin1:
You can find the Fabric 1.17.1 version here: https://www.curseforge.com/minecraft/mc-mods/server-redirect/files/all
Is there a way to force the redirect command at @p when they go through a nether portal?
In reply to skywolftheblack:
If you are using Bukkit, Spigot, Paper, etc., you can use a plugin that runs commands when a player enters a specific nether portal.
If you want to use command blocks, you can try this:
In reply to KaiNoMood:
I'm using forge I hope this works thank you!
In reply to skywolftheblack:
Forge 1.7.10 trying to set up a hub server
In reply to skywolftheblack:
1.7.10 command blocks are limited compared to newer versions! As far as I know, 1.7.10 command blocks do not support the target selector arguments dx, dy, and dz. Additionally, repeating command blocks are not available... so you would have to trigger the command blocks differently.
The easiest solution is to use a simple pressure plate linked to the command block. Assuming the pressure plate is at coordinates 5 64 10 (xyz), the command should be "/redirect @a[x=5,y=64,z=10,r=1] your.server.address.here" (I just tested this). You could also use tripwire hooks and strings, and increase the range of the "r" (range) argument.
I'm afraid that if you really want to use portals you'll have to use a server-side mod that will run the redirect command when someone enters the portal. Potentially, you'll need to hire a software developer to make a 1.7.10 Forge mod that does exactly what you need.
EDIT: In case you still want to use portals in 1.7.10 with command blocks, you can just use a redstone clock to trigger the command block. I suggest a reliable one, like a hopper+comparator redstone clock, which is silent and that's something you want for a hub! It's just two hoppers facing each other (put just one item on one of the hoppers), with a comparator that outputs a pulse you want to connect to a command block. Check this image. The command on the command block can be the same as the one I mentioned above for a pressure plate, with coordinates of the portal.
1.7.10 please I'll pay you.
In reply to skywolftheblack:
Hi. The 1.7.10 version is already available here: https://www.curseforge.com/minecraft/mc-mods/server-redirect/files/3625639
In reply to KaiNoMood:
so cool thank you so much! saved me a lot of money and time I think. I can use this on my server and everything? Like I have your permission? I'll donate what I can if I can afford to get this working to express my gratitude.
In reply to skywolftheblack:
Everyone can use it on their server. I encourage everyone to use it as much as possible on their servers and modpacks! You don't need to ask for permission, it's free to use!
Feel free to ask for help if you have issues setting it up!
if run in a command block, the block tells me i have to permission to use the command, even opped.
if run in console it works fine.
any other program I use to run the command canot pass the player with any @ syntax.
/redirect [address] r=[radius] like say r=5 returns:player r=5 not found
It would almost seem the issues I have are in your program alone. You must specify a player and complete the entire command?
command block uses @s or @p and others use @p but cannot get anything passed as other programs display a 'Player @p not found" which makes no sense as other commands work just fine in command block and other programs.
Has anyone tried this on like a larger modpack like FTB Interactions lol. I know a lot of data/info I assume can't be saves / synced sadly as this is a transfer not like a instance. But be neat to make say a mining world or something else like it.
What is SynX actually?
Hi! Please, can you make add player data transfer between servers, when we redirect player to another server? IDK how to use SyncX, because i using 1.7.10 Thermos server. Please, make it if you can, also, maybe configurable. Thanks!
In reply to Derelanade:
In reply to Forge_User_89693305: