Options class manages all game settings including graphics, audio, controls, and gameplay options. It handles loading, saving, and applying configuration changes.
Constructor
The Minecraft instance (can be NULL for standalone options)
Directory where options file is stored
Initialization
init
Audio Settings
Music volume (0.0 to 1.0)
Sound effects volume (0.0 to 1.0)
Graphics Settings
Render distance:
0- Far1- Normal2- Short3- Tiny
Enable fancy graphics (leaves, water, etc.)
Enable smooth lighting/ambient occlusion:
true- Smooth lighting enabledfalse- Smooth lighting disabled
Enable cloud rendering
Particle effects level:
0- All1- Decreased2- Minimal
Enable 3D anaglyph mode (red/cyan glasses)
Enable advanced OpenGL features (occlusion culling)
Framerate limit:
0- Max1- Balanced2- Power Saver
GUI scale:
0- Auto1- Small2- Normal3- Large
Field of view (0.0 to 1.0, mapped to degrees)
Brightness/gamma (0.0 to 1.0)
Control Settings
Mouse sensitivity (0.0 to 1.0)
Invert mouse Y-axis
Enable view bobbing when walking
Key Mappings
Move forward (default: W)
Move backward (default: S)
Move left (default: A)
Move right (default: D)
Jump (default: Space)
Sneak (default: Left Shift)
Attack/destroy (default: Left mouse button)
Use/place block (default: Right mouse button)
Open inventory (default: E)
Drop item (default: Q)
Open chat (default: T)
Show player list (default: Tab)
Pick block (default: Middle mouse button)
Toggle fog (default: F)
Array of all key mappings
Gameplay Settings
Game difficulty:
0- Peaceful1- Easy2- Normal3- Hard
Third-person camera enabled
Show debug overlay (F3)
Hide HUD/GUI
Advanced Settings
Creative mode flying enabled
Smooth camera movement
Fixed camera position (debug)
Creative mode flight speed
Camera movement speed (spectator)
Network Settings
Last multiplayer server IP address
Skin Settings
Selected player skin name
Methods
load
options.txt).
save
set
The option to set
The new value (0.0 to 1.0 for progress options)
toggle
The option to toggle
Direction: 1 for forward, -1 for backward
getProgressValue
getBooleanValue
getMessage
getKeyDescription
Key mapping index (0-13)
getKeyMessage
setKey
Key mapping index (0-13)
Key code
isCloudsOn
Option Constants
TheOptions::Option nested class defines available options:
Ambient Occlusion Constants
Example Usage
Creating and Loading Options
Modifying Graphics Settings
Adjusting Audio
Configuring Controls
Using Option Toggles
Difficulty Management
Reading Current Settings
File Format
Options are stored inoptions.txt as key-value pairs:
Performance Considerations
Fancy graphics and high render distances significantly impact performance. For optimal framerates on lower-end hardware, use:
viewDistance = 2 or 3(Short/Tiny)fancyGraphics = falseparticles = 2(Minimal)ambientOcclusion = false