Features:
- Forces the port to always be the same when using the Open To LAN feature
- Useful for anyone who wants to use a specific port for their server
- Client-side only
- The port is written in a plain text config file inside the config folder
- A configuration menu is available on recent game versions
- The Fabric API is not required for the mod to work
- An invalid config file falls back to port 25565 instead of crashing
- The port value is checked to be a number between 0 and 65535
- Built with Java 21, so instances before 1.20.5 need a Java 21 or newer runtime
- Works on Fabric for 1.14 and above with mod loader 0.16.0 or newer
- Legacy Fabric support
- For Minecraft 1.4.7
Force Port is a small client-side utility for players who open their world to LAN. Instead of a port that is not the same twice, it pins the Open To LAN feature to a single value you pick, which is exactly what you want whenever a specific port has to be used for your server.
Setting it up takes a moment. Open the config folder of the game instance, find the small plain text file the mod puts there and write the port number you want into it. On recent game versions there is a configuration menu as well. If the file ends up invalid the mod falls back to 25565, the default port for servers, rather than crashing, and the value is checked to be a number between 0 and 65535.
The mod runs entirely on the client and does not need the Fabric API, which keeps it easy to slot into an existing setup. Because it is built with Java 21, instances on versions before 1.20.5 need their Java version raised to 21 or above. It works on Fabric for 1.14 and up with mod loader 0.16.0 or newer, and this build targets Legacy Fabric for Minecraft 1.4.7.