Default Options Mod — Guide
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:
1. File Detection: It looks for the existence of options.txt in the root directory of the Minecraft instance.
2. Initial Setup: If options.txt is missing (indicating a fresh installation), the mod copies all files from the defaultoptions folder into the root directory.
3. 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.
4. Server List Management: It allows for a default servers.dat to 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.
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.
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.