Skip to content

OptionsHelper ​

com.jsmacrosce.jsmacros.client.api.helper.OptionsHelper

Since1.8.4

Provides access to the client's game settings.

Wraps the supplied options object; changes made through this helper affect that object.

Settings are grouped in skin, video, music, control,
chat, and accessibility; each field and its corresponding getter return the same group object.

Setting changes are not necessarily saved to options.txt until saveOptions() is called; some methods save as part of their own behavior.

js
const options = Client.getGameOptions();  
options.video.setRenderDistance(12);  
options.saveOptions();

Nested types ​

Constructors ​

new OptionsHelper ​

new OptionsHelper(Options options)#
Wraps the supplied game options object, retaining its reference.

Parameters:

  • options: game options to wrap

Fields ​

accessibility ​

accessibility: OptionsHelper.AccessibilityOptionsHelperSince1.8.4read-only#
Accessibility settings. Some settings are also exposed by other groups and operate on the same underlying option.

chat ​

chat: OptionsHelper.ChatOptionsHelperSince1.8.4read-only#
Chat display and behavior settings.

control ​

control: OptionsHelper.ControlOptionsHelperSince1.8.4read-only#
Input settings and key bindings.

music ​

music: OptionsHelper.MusicOptionsHelperSince1.8.4read-only#
Sound volumes, audio device selection, and subtitles. Per-category volumes are available by category name or through individual methods.

skin ​

skin: OptionsHelper.SkinOptionsHelperSince1.8.4read-only#
Player skin model-part visibility and main-hand settings.

video ​

video: OptionsHelper.VideoOptionsHelperSince1.8.4read-only#
Graphics and video settings.

Methods ​

getAccessibilityOptions ​

getAccessibilityOptions(): OptionsHelper.AccessibilityOptionsHelperSince1.8.4#
Returns: the accessibility options group.

getCameraMode ​

getCameraMode(): intSince1.5.0#
Returns: 0 for first person, 1 for third person from behind, or 2 for third person from the front

getChatOptions ​

getChatOptions(): OptionsHelper.ChatOptionsHelperSince1.8.4#
Returns: the chat options group.

getControlOptions ​

getControlOptions(): OptionsHelper.ControlOptionsHelperSince1.8.4#
Returns: the control options group.

getDifficulty ​

getDifficulty(): StringSince1.8.4#
Returns: the active difficulty's name: peaceful, easy, normal, or hard.

getEnabledResourcePacks ​

getEnabledResourcePacks(): List<String>Since1.2.0#
Returns: the selected resource-pack IDs.

getFov ​

getFov(): intSince1.1.7#
Returns: the configured field-of-view value

getHeight ​

getHeight(): intSince1.2.6#
Returns: the window's screen height in pixels

getLanguage ​

getLanguage(): StringSince1.8.4#
Returns: the configured language code.

getMusicOptions ​

getMusicOptions(): OptionsHelper.MusicOptionsHelperSince1.8.4#
Returns: the music options group.

getResourcePacks ​

getResourcePacks(): List<String>Since1.1.7#
Returns: the available resource-pack IDs.

getSkinOptions ​

getSkinOptions(): OptionsHelper.SkinOptionsHelperSince1.8.4#
Returns: the skin options group.

getSmoothCamera ​

getSmoothCamera(): booleanSince1.5.0#
Returns: whether smooth camera is enabled

getVideoOptions ​

getVideoOptions(): OptionsHelper.VideoOptionsHelperSince1.8.4#
Returns: the video options group.

getWidth ​

getWidth(): intSince1.2.6#
Returns: the window's screen width in pixels

isDifficultyLocked ​

isDifficultyLocked(): booleanSince1.8.4#
Returns: true if the current world's difficulty is locked

lockDifficulty ​

lockDifficulty(): OptionsHelperSince1.8.4#
Sends a request to lock the world's difficulty.
Returns: this helper for chaining

removeServerResourcePack ​

removeServerResourcePack(boolean state): OptionsHelperSince1.8.3#
Disables or allows server-provided resource packs. Reloads packs only when the disabled state changes.

Parameters:

  • state: true to disable server-provided resource packs; false to allow them
Returns: self for chaining

saveOptions ​

saveOptions(): OptionsHelperSince1.8.4#
Returns: this helper for chaining.

sendSyncedOptions ​

sendSyncedOptions(): voidSince2.0.0#
Sends the current synchronized options to the server. Setting changes do not automatically call this method; call it manually when those changes need to be broadcast.

setCameraMode ​

setCameraMode(int mode): OptionsHelperSince1.5.0#

Parameters:

  • mode: 0 for first person, 1 for third person from behind, or 2 for third person from the front
Returns: self for chaining

setDifficulty ​

setDifficulty(String name): OptionsHelperSince1.8.4#
Sets the singleplayer world's difficulty; multiplayer clients do not apply this change.

Parameters:

  • name: peaceful, easy, normal, or hard
Returns: self for chaining.

setEnabledResourcePacks ​

setEnabledResourcePacks(String[] enabled): OptionsHelperSince1.2.0#
Selects resource packs, saves the options, and reloads packs if the saved selection changes.

Parameters:

  • enabled: resource-pack IDs to select; duplicate IDs are ignored
Returns: this helper for chaining

setFov ​

setFov(int fov): OptionsHelperSince1.1.7#

Parameters:

  • fov: the new field-of-view value
Returns: this helper for chaining

setHeight ​

setHeight(int h): OptionsHelperSince1.2.6#
Sets the window's screen height, preserving its current screen width.

Parameters:

  • h: the height in pixels
Returns: self for chaining

setLanguage ​

setLanguage(String languageCode): OptionsHelperSince1.8.4#
Selects the language if its code is recognized, then always reloads resource packs and saves options.

Parameters:

  • languageCode: language code to select
Returns: this helper for chaining

setSize ​

setSize(int w, int h): OptionsHelperSince1.2.6#
Sets the window's screen size.

Parameters:

  • w: the width in pixels
  • h: the height in pixels
Returns: self for chaining

setSmoothCamera ​

setSmoothCamera(boolean val): OptionsHelperSince1.5.0#
Sets whether smooth camera is enabled.

Parameters:

  • val: true to enable smooth camera; false to disable it
Returns: self for chaining

setWidth ​

setWidth(int w): OptionsHelperSince1.2.6#
Sets the window's screen width, preserving its current screen height.

Parameters:

  • w: the width in pixels
Returns: self for chaining

unlockDifficulty ​

unlockDifficulty(): OptionsHelperSince1.8.4#
Sends a request to unlock the world's difficulty; the server may reject it if the player lacks permission.
Returns: this helper for chaining