Force Port
by GalvinPython
Force Port fixes the port that Minecraft's Open to LAN feature uses, so the same port number is reused each time a world is opened.
What it does
When a player opens a singleplayer world to LAN, the game normally picks a random port. Force Port replaces that choice with a port the player sets once, so the address stays the same from session to session. The port is changed by editing a plain text file, forceport.txt, found in the Minecraft instance's config folder, which opens in any text editor. The mod checks that the number falls between 0 and 65535 and rejects values outside that range.
Force Port is client-side only, so it has to be installed on the player's client and nothing is needed on a server. It requires Fabric API, works with Fabric 1.14 and later through Fabric Loader 0.16.0 or newer, and is also published for Quilt, while Legacy Fabric has a file for 1.13.2. The mod was built with Java 21, so instances on earlier Java versions must be switched to Java 21 or newer, and older builds prior to 1.20.5 are the ones it is meant to run on. The author notes that older Quilt versions have not been tested. Files cover 1.0 – 26.3 in the catalog, and the code is open source under the MIT License.
Key features
Fixed LAN port
The port used by Open to LAN stays the same across sessions, so a friend can reconnect with the same address.
Port set in a text file
The port is changed in forceport.txt in the instance's config folder, without any in-game menu.
Port range check
Values are checked to fall between 0 and 65535 before they are applied.
Configuration menu
Recent Minecraft versions also offer a configuration menu for the port setting.
Gallery
Compatibility
Latest build for each game version and loader.
26.x3 of 3 versions with builds
1.21.x12 of 12 versions with builds
1.20.x7 of 7 versions with builds
1.19.x5 of 5 versions with builds
1.18.x3 of 3 versions with builds
1.17.x2 of 2 versions with builds
1.16.x6 of 6 versions with builds
1.15.x3 of 3 versions with builds
1.14.x5 of 5 versions with builds
1.13.x2 of 2 versions with builds
Only full game releases are shown. This mod publishes no snapshot builds.
53 older game versions (1.0 – 1.13) not shown. All files on Modrinth
Use cases
Who it’s for: Players who host singleplayer worlds over Open to LAN and want the same port each time, and players who forward a router port to a LAN host.
How it compares
LAN Properties is a Fabric, Forge, NeoForge, Quilt, Legacy Fabric and Ornithe mod for 1.12 – 1.21.8, released under the Apache License 2.0 and open source, and it runs on client and server. LAN Operators is a Fabric client-side mod for 1.16 – 1.21.4 under the MIT License, also open source. Force Port works only on Fabric and Quilt and changes just the LAN port, without reaching into operator or server settings.
| Mod | Loaders | Game versions | Environment | Updated |
|---|---|---|---|---|
| Force Port | Fabric, Quilt and Legacy Fabric | 1.0 – 26.3 | Client-side only | 2026-09-22 |
| LAN Properties | Fabric, Forge, NeoForge, Quilt, Legacy Fabric and Ornithe | 1.12 – 1.21.8 | Client and server | 2026-02-10 |
| LAN Operators | Fabric | 1.16 – 1.21.4 | Client-side only | 2024-12-29 |
Questions
Does Force Port need Fabric API?
Does Force Port have to be installed on a server?
Which Java version does Force Port need?
Where is the port set?
In the catalog
Force Port is one of 8,499 Technology mods on ModsFinder, and one of 4,201 Technology mods for Fabric. 8,071 mods support Minecraft 26.3.
More from GalvinPython
Similar mods
What the author says
A mod that forces the port to always be the same when using the "Open To LAN" feature! Just go to the installation location for that Minecraft instance, and open the config folder. You should see a file called forceport.txt. Open it with a text editor and change the port to your desired port.
Official listing
- Modrinth page
- modrinth.com/mod/forceport
- Owner
- GalvinPython
- Published
- 2024-10-18
- Updated on Modrinth
- 2026-09-22
- Facts verified
- 2026-10-15
