This mod reworks the Open To Lan and /publish command. Here's the changes:
/publish
renamed to /open
and can be used without cheats enabled.
To open your world to anyone, use /open <port>
and make sure the port is forwarded on your router.
On the Open to LAN screen, the port will always be set to 25565
instead of a random number.
NOTICE: This mod REQUIRES the Fabric API. Get it from here: https://www.curseforge.com/minecraft/mc-mods/fabric-api
In Minecraft Java Edition, you can't realistically play with your friends on a cheats-off survival mode world, so this mod fixes that by letting you choose the port you open to, or always setting it to a static value.
What now?
Once your world is open, give your friends your public IP address and your port.
Most of the time, it'll look something like this, (note this is a fake address):
192.185.383.68:25565
All your friends have to do is join using the number you give them for the server address.
This works exactly the same way you'd set it up using a server. If you still don't understand, look at the tutorials for setting up dedicated servers as it's a similar process.
Q. It doesn't work?
A. Make sure the mod is installed, make sure the port is forwarded in your router. If you router has upnp, and you can't port forward, try this: https://www.curseforge.com/minecraft/mc-mods/mcpnp
Q. Where's your website?
A. It doesn't exist yet, but it's going to be in the works soon.
CC0; read the LICENSE file located on the root directory on the master branch.