KaiKikuchi/ServerRedirect

port number support

Closed this issue · 7 comments

Could we get port support? The ability to add port numbers to the end of the server address?

This is already supported! You separate the IP and the Port by a colon. It is the same as you do in Minecraft when you click the "Direct Connect" button the Multiplayer screen. Your server must be configured to let players join when using the "Direct Connect" button.

Example:
Server IP: 127.0.0.1
Server Port: 25123

Use the /redirect command like this: /redirect PlayerName 127.0.0.1:25123

Then something is wrong as when I try that it says "Expected whitespace to end one argument, but found trailing data ...2.168.1.17:25566<--[HERE]"

I think I need more information about where you are using Server Redirect. Is this on Spigot/Paper, Sponge or Forge? Which version of Minecraft are you using? Are you using Command Blocks? Do you get the same error without specifying the port? What command are you running exactly? Thanks for reporting the issue, I will look into it once I get enough details

I am running forge minecraft version 1.18.1. I do not get the error without specifying the port. Running the serverredirect command directly. redirect does not seem to be a valid command in this version. I have the mod on both the server and the client.

Thanks for the reply. This is indeed a weird thing happening on Forge 1.18.1. It seems to be related to the way Forge (or Mojang's Brigadier) handles string arguments. I tested it and I could replicate the "Expected whitespace to end one argument, but found trailing data" error. It seems that it does not like the colon in the argument.

Luckily, I thought of trying this workaround: by placing the address between quotes, the command will run just fine!

I suggest to try /redirect @s "2.168.1.17:25566" instead (if that's the correct IP address). I have tested this and works fine.

Let me know if this fixes your issue, at least temporarily! I will try to find a better solution in newer versions of the mod that won't require quotes for the server address.

Thank you for reporting the issue!

It works with the quotes.

Fixed in version 1.4.1.

Notice: the quotes will no longer be accepted by the commands!