Overview#
Default Options is a technical utility mod that solves a common issue in Minecraft modding: the management of the options.txt file. In standard modpacks, including an options.txt file in the distribution would cause a user's custom settings (like sensitivity, volume, or graphics) to be reset every time the modpack is updated.
This mod allows developers to ship a defaultoptions folder instead. On the first launch of the modpack, the mod populates the game's settings from this folder. On subsequent launches, it respects the user's changes, ensuring that updates do not interfere with personal preferences while still providing a functional baseline for new players.
Mechanics and Functionality#
The mod operates based on a "First Run" logic and specific file detection. It does not add any gameplay elements like mobs, blocks, or biomes, but instead modifies the initialization sequence of the Minecraft client.
Initialization Logic
When the Minecraft client starts with this mod installed, it performs the following checks:
- File Detection: It looks for the existence of
options.txtin the root directory of the Minecraft instance. - Initial Setup: If
options.txtis missing (indicating a fresh installation), the mod copies all files from thedefaultoptionsfolder into the root directory. - Keybinding Preservation: The mod handles keybindings separately to ensure that mod-added keys do not conflict. It can merge default keybindings with existing ones if configured to do so.
- Server List Management: It allows for a default
servers.datto be provided, which is especially useful for official modpack servers.
Update Persistence
Because the mod only copies files when they are missing, modpack updates that include changes to the defaultoptions folder will not overwrite a player's existing options.txt. This allows players to keep their custom keybinds and video settings across multiple versions of a modpack.
Commands#
The mod provides several commands for modpack authors to easily generate the necessary default files. These commands should be run after the author has configured their game settings exactly how they want them to appear for the end-user.
| Command | Description |
|---|---|
/defaultoptions saveOptions |
Saves the current options.txt (video settings, audio, etc.) into the defaultoptions folder. |
/defaultoptions saveKeys |
Saves the current keybindings into the defaultoptions folder. |
/defaultoptions saveServers |
Saves the current server list (servers.dat) into the defaultoptions folder. |
Note: These commands require cheat permissions (OP) to execute in-game.
Folder Structure#
To function correctly, the mod expects a specific directory layout within the Minecraft instance. Modpack authors must place their default files in a folder named defaultoptions located in the root directory (the same level as the mods and config folders).
Expected Layout:
.minecraft/config/mods/defaultoptions/options.txt(Contains general settings)servers.dat(Contains the default server list)optionsof.txt(Contains OptiFine settings, if applicable)optionsshaders.txt(Contains Shaders settings, if applicable)
When the mod runs for the first time, it moves these files up one level into the .minecraft/ root folder.
Supported Files#
Default Options is compatible with several standard Minecraft and mod-specific configuration files:
- options.txt: The primary file for Minecraft's internal settings (FOV, Difficulty, Graphics, etc.).
- servers.dat: The file containing the list of multiplayer servers.
- optionsof.txt: Used by OptiFine to store its extensive graphical settings.
- optionsshaders.txt: Used by OptiFine and some shader loaders to store shader-specific configurations.
- Keybindings: While stored within
options.txt, the mod treats these with specific logic to allow for better integration across different keyboard layouts.
Modpack Author Guide#
To implement Default Options in a modpack, follow these steps:
- Install the mod and launch the game.
- Configure all settings (Video, Audio, Controls, etc.) to the desired defaults for the pack.
- Add any official servers to the multiplayer server list.
- Run the commands
/defaultoptions saveOptions,/defaultoptions saveKeys, and/defaultoptions saveServers. - Navigate to your instance folder and locate the newly created
defaultoptionsfolder. - Include this
defaultoptionsfolder in your modpack distribution. - Crucial: Do not include the actual
options.txtorservers.datfiles in the root of your modpack distribution, as this would defeat the purpose of the mod and overwrite user settings on every update.
Troubleshooting#
Defaults Not Applying
If the default settings are not applying to a fresh installation, ensure that:
- The
defaultoptionsfolder is spelled correctly and located in the root directory, not inside theconfigfolder. - The
options.txtfile is not already present in the root directory before the first launch.
Keybindings Resetting
If keybindings are resetting unexpectedly, check if another mod is managing keybindings (such as a dedicated keybind manager). Default Options is designed to be the primary handler for these settings.
If servers are appearing twice, ensure that the servers.dat is only present in the defaultoptions folder and not also packaged in the root directory of the modpack.
Gallery#
