Skip to main content
The Options class manages all game settings including graphics, audio, controls, and gameplay options. It handles loading, saving, and applying configuration changes.

Constructor

Creates a new Options instance.
Minecraft*
The Minecraft instance (can be NULL for standalone options)
File
Directory where options file is stored

Initialization

init

Initializes all options with default values. Called automatically by the constructor.

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 - Far
  • 1 - Normal
  • 2 - Short
  • 3 - Tiny
bool
Enable fancy graphics (leaves, water, etc.)
bool
Enable smooth lighting/ambient occlusion:
  • true - Smooth lighting enabled
  • false - Smooth lighting disabled
bool
Enable cloud rendering
int
Particle effects level:
  • 0 - All
  • 1 - Decreased
  • 2 - Minimal
bool
Enable 3D anaglyph mode (red/cyan glasses)
bool
Enable advanced OpenGL features (occlusion culling)
int
Framerate limit:
  • 0 - Max
  • 1 - Balanced
  • 2 - Power Saver
int
GUI scale:
  • 0 - Auto
  • 1 - Small
  • 2 - Normal
  • 3 - 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 - Peaceful
  • 1 - Easy
  • 2 - Normal
  • 3 - 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

Loads options from the options file (options.txt).

save

Saves current options to the options file.

set

Sets an option to a specific value.
const Options::Option*
The option to set
float
The new value (0.0 to 1.0 for progress options)

toggle

Toggles or cycles an option value.
const Options::Option*
The option to toggle
int
Direction: 1 for forward, -1 for backward

getProgressValue

Gets the current value of a progress-based option (0.0 to 1.0).

getBooleanValue

Gets the current value of a boolean option.

getMessage

Gets the localized display message for an option’s current value.

getKeyDescription

Gets the description for a key mapping.
int
Key mapping index (0-13)

getKeyMessage

Gets the current key binding message for display.

setKey

Sets a key binding.
int
Key mapping index (0-13)
int
Key code

isCloudsOn

Returns whether cloud rendering is enabled.

Option Constants

The Options::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 in options.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 = false
  • particles = 2 (Minimal)
  • ambientOcclusion = false