Options class manages all game settings including graphics, audio, controls, and gameplay options. It handles loading, saving, and applying configuration changes.
Constructor
Minecraft*
The Minecraft instance (can be NULL for standalone options)
File
Directory where options file is stored
Initialization
init
Audio Settings
float
Music volume (0.0 to 1.0)
float
Sound effects volume (0.0 to 1.0)
Graphics Settings
int
Render distance:
0- Far1- Normal2- Short3- Tiny
bool
Enable fancy graphics (leaves, water, etc.)
bool
Enable smooth lighting/ambient occlusion:
true- Smooth lighting enabledfalse- Smooth lighting disabled
bool
Enable cloud rendering
int
Particle effects level:
0- All1- Decreased2- Minimal
bool
Enable 3D anaglyph mode (red/cyan glasses)
bool
Enable advanced OpenGL features (occlusion culling)
int
Framerate limit:
0- Max1- Balanced2- Power Saver
int
GUI scale:
0- Auto1- Small2- Normal3- Large
float
Field of view (0.0 to 1.0, mapped to degrees)
float
Brightness/gamma (0.0 to 1.0)
Control Settings
float
Mouse sensitivity (0.0 to 1.0)
bool
Invert mouse Y-axis
bool
Enable view bobbing when walking
Key Mappings
KeyMapping*
Move forward (default: W)
KeyMapping*
Move backward (default: S)
KeyMapping*
Move left (default: A)
KeyMapping*
Move right (default: D)
KeyMapping*
Jump (default: Space)
KeyMapping*
Sneak (default: Left Shift)
KeyMapping*
Attack/destroy (default: Left mouse button)
KeyMapping*
Use/place block (default: Right mouse button)
KeyMapping*
Open inventory (default: E)
KeyMapping*
Drop item (default: Q)
KeyMapping*
Open chat (default: T)
KeyMapping*
Show player list (default: Tab)
KeyMapping*
Pick block (default: Middle mouse button)
KeyMapping*
Toggle fog (default: F)
KeyMapping*[14]
Array of all key mappings
Gameplay Settings
int
Game difficulty:
0- Peaceful1- Easy2- Normal3- Hard
bool
Third-person camera enabled
bool
Show debug overlay (F3)
bool
Hide HUD/GUI
Advanced Settings
bool
Creative mode flying enabled
bool
Smooth camera movement
bool
Fixed camera position (debug)
float
Creative mode flight speed
float
Camera movement speed (spectator)
Network Settings
wstring
Last multiplayer server IP address
Skin Settings
wstring
Selected player skin name
Methods
load
options.txt).
save
set
const Options::Option*
The option to set
float
The new value (0.0 to 1.0 for progress options)
toggle
const Options::Option*
The option to toggle
int
Direction: 1 for forward, -1 for backward
getProgressValue
getBooleanValue
getMessage
getKeyDescription
int
Key mapping index (0-13)
getKeyMessage
setKey
int
Key mapping index (0-13)
int
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